What is vldPersonals?

vldPersonals is a very easy to use dating/social software. It allows you to create a fully functioning & modern dating website in a matter of minutes. If You think it's too complicated - check vldPersonals!
Know more about how You can become a dating website owner

What is vldCrowd?

vldCrowd.com is the biggest unofficial community of vldPersonals owners. It is a place to share ideas and thoughts about Your dating website. It is a place to answer questions and receive answers.
Do You own a vldPersonals license? Don't hesitate and join!

Connect Today

Community members help each other to take their dating websites to the next level. Can You make your vldPersonals website better? Join and find out...

Connect With More Than 500 Dating Website Owners! Sign Up Today

Search RSS

11/05/2009 07:54 PM
271 1 5
Currently ONLY (as of 2.5.3) saved searches can have RSS feeds.
 
This mod allows hardcoded searches like:
http://www.yoursite.com/index.php?m=search&issearch=1&gender1=2
to be RSSd, by adding &rss to the query string.
eg:
http://www.yoursite.com/index.php?m=search&issearch=1&gender1=2&rss
 
So in this example , with the above link, people will have access to an RSS feed for the last X females who joined your dating site, assuming:

    gender1 value of 2 is a female
    X being the number of results shown per search results page

It took me 10mins to write this mod, so please backup your code, and if you see any potential problems, or ways it could be done better, or bugs please let us know.
 
In my very limited testing with my site (which is not open yet) it seems to work, so fingers crossed.
 
Also this is tested with vld 2.5.3
 
In .htaccess:
Find
RewriteRule ^search/([0-9a-zA-Z]+)/?$ index.php?m=search&s=$1
 
Replace with:
RewriteRule ^search/([0-9a-zA-Z]+)/?$ index.php?m=search&s=$1&%{QUERY_STRING}
 
In lib.search.php:
Find the line starting with:
redirect(VIR_PATH . ($PREFS->conf['fancy_urls'] ? "search/$search_hash/
IMPORTANT: ONLY THE ONE WITHIN THE FUNCTION show_search($advanced)
 
Replace it with:
//MOD START
$rss_string = "";
$rss_fancy_string = "";
if ( isset($_GET['rss']) ) {
 
$rss_string = "&rss";
$rss_fancy_string = "?rss";
 
}
 
redirect(VIR_PATH . ($PREFS->conf['fancy_urls'] ? "search/$search_hash/$rss_fancy_string" : "index.php?m=search&s=$search_hash$rss_string"));
//MOD END
 
The final mods are all within the function show_search_results($hash, $page).
Find:
$TEMPLATE->set_template("search_results.tpl");
 
Replace it with:
//MOD START
if ( !isset($_GET['rss']) ) {
 
$TEMPLATE->set_template("search_results.tpl");
 
} else {
 
$search_orderby = 'joindate';
 
}
//MOD END
 
Find:
$search_orderby = $obj->query_orderby ? $obj->query_orderby : 'lastvisit';
 
Replace it with:
if ( !isset($_GET['rss']) ) $search_orderby = $obj->query_orderby ? $obj->query_orderby : 'lastvisit'; //MOD
 
Find:
$directionbox['asc'] = $LANG['search']['ascending'];
 
THEN PLACE AFTER (NOT REPLACE):
//MOD START
if ( isset($_GET['rss']) ) {
 
//------------------------------------------------
 
// Parse feed header
 
//------------------------------------------------
 
$output =
 
'<?xml version="1.0" encoding="utf-8"?>
 
<rss version="2.0">
 
<channel>
 
<title>'.htmlentities2utf8($PREFS->conf['app_title'] . ' | ' . $LANG['search']['app_search_rss']).'</title>
 
<link></link>
 
<description>'.htmlentities2utf8($PREFS->conf['app_description']).'</description>';
 
//------------------------------------------------
 
// Parse feed items
 
//------------------------------------------------
 
$TEMPLATE->assign('search_profiles', $profile_obj);
 
$output .= $TEMPLATE->result('search_rss.tpl');
 
$output .= '</channel></rss>';
 
header('Content-Type: application/rss+xml; charset=utf-8');
 
echo $output;
 
exit();
 

}
//MOD END
 
If anybody adds this their live site I would love to know, and see it in action with a more complete member base than my 10 test members.
 
A mod like this will hopefully keep your members coming back.

Comments

idealists

  • Posted on 11/05/2009 10:31 PM
Oh well, I tried :)
 
I still like my mod - the URL is more friendly and doesn't need admin to create saved searches!

radioact

  • Posted on 11/05/2009 10:22 PM
SEO guys from United States
This will work unless I delete it, but I won't :)

idealists

  • Posted on 11/05/2009 10:07 PM
Because saved searches are restricted to the member who saves them.
 
The point of this is so you could have a hard-coded link, visible to all members, saying something like:
Latest female members RSS feed.
eg:
<a href="http://www.yoursite.com/index.php?m=search&issearch=1&gender1=2&rss">Latest female members -RSS feed.</a>
Maybe next to a hard-code search on female members:
<a href="http://www.yoursite.com/index.php?m=search&issearch=1&gender1=2">All Female members</a>

radioact

  • Posted on 11/05/2009 09:44 PM
Sounds great, Idealists. Though why not we just create set of necessary saved searches and share their rss links with other site members?

idealists

  • Posted on 11/05/2009 07:57 PM
Re:htaccess line.
The resulting line after the mod should look like:
RewriteRule ^search/([0-9a-zA-Z]+)/?$ index.php?m=search&s=$1&%{QUERY_STRING} [L]

Log in to leave a comment