View previous topic :: View next topic |
Author |
Message |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Sat Jan 18, 2003 5:19 am Post subject: Wander Lust |
|
|
For those of you using Wander Lust service, use the following block of code for it. Just save it in its own php file; I saved it as "wander.php". Hope this helps someone.
Code: |
<?php
require('./b2config.php');
$dbconnect = mysql_connect($dbhost, $dbusername, $dbpassword) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query = mysql_query("SELECT post_title, post_content FROM $tableposts ORDER BY post_date DESC LIMIT 1");
$row = mysql_fetch_object($query);
$title = stripslashes($row->post_title);
$content = stripslashes($row->post_content);
mysql_close($dbconnect);
?>
<!--syndicate
<?php echo $title." | ".$content; ?>
/syndicate-->
|
_________________ Michael P. |
|
Back to top |
|
 |
Pam Guest
|
Posted: Sat Jan 25, 2003 4:24 pm Post subject: Works great..but.. |
|
|
It works great but is there a way to include this in with the actual weblog page, instead of calling up a seperate wander.php? Just wondering. |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Sat Jan 25, 2003 5:27 pm Post subject: |
|
|
Why would you want to do that? I mean, the purpose of that code is to separate it from the rest of the b2 so that it won't use as much as resources just for Wander Lust.
If you wish to do that, search for "wander-lust". I believe Michel provided a way to do what you want to do. _________________ Michael P. |
|
Back to top |
|
 |
Pam Guest
|
Posted: Sat Jan 25, 2003 6:08 pm Post subject: I see your point.. |
|
|
Ok.. one more question.. when I use it this way.. do I just tell wander-lust to spider http:// ...url/wander.php ? I've did it this way, and it works ok.. only thing is that its posting my IP address on their website, and not my domain name. If I point their spider to http://www.southernblog.com/wander.php then it doesn't work.. tells me there are no syndication tags on the page.. but if I replace southernblog with my actual IP.. then it works.. am I crazy? or just confused
Any ideas?
Thanks! |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Sat Jan 25, 2003 6:43 pm Post subject: |
|
|
I think it's because the file is included in frames. And I don't really understand what you are saying. To my knowledge, they don't display IP addresses.
Are you running your own server? _________________ Michael P. |
|
Back to top |
|
 |
xinit
Joined: 25 Jan 2003 Posts: 6
|
Posted: Mon Feb 03, 2003 4:06 pm Post subject: Re: Wander Lust |
|
|
Cyberian75 wrote: |
Code: |
<?php
require('./b2config.php');
$dbconnect = mysql_connect($dbhost, $dbusername, $dbpassword) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
|
|
I've seen some discussion on how to do this, and I'm confused why you're doing an SQL query at all, actually when you can just add a simple tag to the entry before submission to the DB;
Code: |
$wanderlust_tag = "\n\n<!-- syndicate $post_title | ".substr($content,0,60) . "... /syndicate-->";
$content .= $wanderlust_tag;
|
This bit of code added to around line 74 of b2edit.php (just before $query = "INSERT INTO $tableposts...) works to insert the tags into the content of the article. You can then either hit the wanderlust spider page, or have them automatically spider. No extra queries, so I'm thinking I've got the least performance-affecting code yet  |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Mon Feb 03, 2003 5:11 pm Post subject: |
|
|
I have written the provided code to be in a separate file. I don't like to include it in any of the b2 files, because it will be carried out everytime b2 is run. Also, if it's done with the main query, no limit will be specified.
My code only "pulls out" one latest entry and that's it, and it's only ran when you or the spider needs it.
By the way, does the code you provided really work? I mean, it seems to me that it wouldn't work simply because a user needs to be logged in to access the "post" section of b2edit page. _________________ Michael P. |
|
Back to top |
|
 |
cukkoo
Joined: 25 Feb 2003 Posts: 17
|
Posted: Thu Feb 27, 2003 2:58 pm Post subject: Thanks |
|
|
Thankyou Cyberian75 - Your code was just what I needed It works like a dream! |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Thu Feb 27, 2003 4:50 pm Post subject: |
|
|
You are very welcome.
And if you want to add a link on the b2edit menu on the top, open up "b2menutop.txt" file located in b2-include directory and add in the following:
Code: |
N http://wander-lust.com/pinger.cgi?you@email Wander-Lust Pinger
|
_________________ Michael P. |
|
Back to top |
|
 |
annia
Joined: 09 Apr 2002 Posts: 18
|
Posted: Sun Mar 02, 2003 10:00 pm Post subject: |
|
|
what is wander lust? O_o |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Mon Mar 03, 2003 2:09 am Post subject: |
|
|
Visit www.wander-lust.com _________________ Michael P. |
|
Back to top |
|
 |
TigerDE2
Joined: 04 Jan 2003 Posts: 53 Location: Germany, Erfurt
|
Posted: Fri Mar 07, 2003 4:30 pm Post subject: |
|
|
Sounds German...
(And would even make some sense...) _________________ Make me happy.
Correct my awful grammar and spelling mistakes...
-----
b2 is now WordPress.
Names change, excellence remains. Go, change. |
|
Back to top |
|
 |
livediary
Joined: 12 Jan 2003 Posts: 15 Location: Austin, TX
|
Posted: Tue Mar 18, 2003 7:14 pm Post subject: Re: Wander Lust |
|
|
Cyberian75 wrote: | For those of you using Wander Lust service, use the following block of code for it. |
Thanks so much for this! It's a LIFESAVER!
Now, it says on the wander-lust website that when using its spider, you ping at
http://wander-lust.com/[email protected]
so does this mean we have to do it manually after every new entry? Or does it automatically ping with each new post?
edit 1: Also, I don't want my entire entry to show up on the list of last updated blogs in 48 hours etc (on wander-lust) so instead of $content is there another that will do just the first x amount of words? _________________ www.live-diary.com |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Sun Mar 23, 2003 6:45 am Post subject: |
|
|
livediary,
As for your first question, the spider does ping your site automatically... eventually. Because of their volume is so high, it takes a few hours ping to every site. So it's better if you manually have your site pinged.
And for your second question, don't worry about it, because, by default, only a few words are displayed on their site even the the spider takes the entry in its entirety. _________________ Michael P. |
|
Back to top |
|
 |
livediary
Joined: 12 Jan 2003 Posts: 15 Location: Austin, TX
|
|
Back to top |
|
 |
|