boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wander Lust

 
Post new topic   Reply to topic    boardom Forum Index -> PHP help
View previous topic :: View next topic  
Author Message
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Sat Jan 18, 2003 5:19 am    Post subject: Wander Lust Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Pam
Guest





PostPosted: Sat Jan 25, 2003 4:24 pm    Post subject: Works great..but.. Reply with quote

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

PostPosted: Sat Jan 25, 2003 5:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Pam
Guest





PostPosted: Sat Jan 25, 2003 6:08 pm    Post subject: I see your point.. Reply with quote

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 Smile

Any ideas?

Thanks!
Back to top
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Sat Jan 25, 2003 6:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
xinit



Joined: 25 Jan 2003
Posts: 6

PostPosted: Mon Feb 03, 2003 4:06 pm    Post subject: Re: Wander Lust Reply with quote

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 Smile
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Mon Feb 03, 2003 5:11 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
cukkoo



Joined: 25 Feb 2003
Posts: 17

PostPosted: Thu Feb 27, 2003 2:58 pm    Post subject: Thanks Reply with quote

Thankyou Cyberian75 - Your code was just what I needed Smile It works like a dream!
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Thu Feb 27, 2003 4:50 pm    Post subject: Reply with quote

You are very welcome. Smile

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
View user's profile Send private message Visit poster's website AIM Address
annia



Joined: 09 Apr 2002
Posts: 18

PostPosted: Sun Mar 02, 2003 10:00 pm    Post subject: Reply with quote

what is wander lust? O_o
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Mon Mar 03, 2003 2:09 am    Post subject: Reply with quote

Visit www.wander-lust.com
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
TigerDE2



Joined: 04 Jan 2003
Posts: 53
Location: Germany, Erfurt

PostPosted: Fri Mar 07, 2003 4:30 pm    Post subject: Reply with quote

Sounds German...
(And would even make some sense...)
_________________
Make me happy. Smile
Correct my awful grammar and spelling mistakes...
-----
b2 is now WordPress.
Names change, excellence remains. Go, change.
Back to top
View user's profile Send private message
livediary



Joined: 12 Jan 2003
Posts: 15
Location: Austin, TX

PostPosted: Tue Mar 18, 2003 7:14 pm    Post subject: Re: Wander Lust Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Sun Mar 23, 2003 6:45 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
livediary



Joined: 12 Jan 2003
Posts: 15
Location: Austin, TX

PostPosted: Sun Mar 23, 2003 7:51 am    Post subject: Reply with quote

Thanks!
_________________
www.live-diary.com
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> PHP help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group