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. View Comments & Reply...
He is currently doing some major custom vldpersonals design work for me and his work is awesome, and he is very professional, talented and has been able to ( so far :) ) put up with me - a perfectionist.
If anybody here wants a template or custom design work done for vldpersonals, do NOT use odesk or elance (trust me I have been there, done that - before I knew Oleg - and regretted it). Use Oleg - or be sorry! View Comments & Reply...
It has been great getting to know you, and working with you these past few weeks!
Been an honour and a pleasure (don't take the later the wrong way now) :) View Comments & Reply...
In the messaging area, smilies are currently ONLY displayed when you read a message that is in your inbox or sentbox. The short message preview in your inbox/sentbox doesn't display a graphical smilie that may exist in the short 75 character preview, it just displays the code.
Three files need to be changed (make backups etc before):
includes/lib/lib.account_messages.php
In the function show_inbox($page) { code:
look for, $fields[$i]['message_body'] = htmlentities2utf8($obj['body']);
and replace it with:
// MOD - Show smilies in inbox/outbox by MS - start
//$fields[$i]['message_body'] = htmlentities2utf8($obj['body']);
$fields[$i]['message_body'] = substr(nl2br(htmlentities2utf8($obj['body'])),0,75);
if ($PREFS->conf['pm_enable_smilies']) {
$fields[$i]['message_body'] = parse_words($fields[$i]['message_body'], array('smilies'));
}
// MOD - Show smilies in inbox/outbox by MS - end
Same file, in the function show_sent($page) { code:
look for, $fields[$i]['message_body'] = htmlentities2utf8($obj['body']);
and replace it with:
// MOD - Show smilies in inbox/outbox by MS - start
//$fields[$i]['message_body'] = htmlentities2utf8($obj['body']);
$fields[$i]['message_body'] = substr(nl2br(htmlentities2utf8($obj['body'])),0,75);
if ($PREFS->conf['pm_enable_smilies']) {
$fields[$i]['message_body'] = parse_words($fields[$i]['message_body'], array('smilies'));
}
// MOD - Show smilies in inbox/outbox by MS - end
In the file:
/templates/{your template directory}/account_messages_inbox.tpl
Find:
{trim:message_body,75}
And replace it with:
<?php /* MOD - Show smilies in inbox/outbox by MS - start */ ?>
{message_body}
<?php /* MOD - Show smilies in inbox/outbox by MS - end */ ?>
In the file:
/templates/{your template directory}/account_messages_sent.tpl
Find:
{trim:message_body,75}
And replace it with:
<?php /* MOD - Show smilies in inbox/outbox by MS - start */ ?>
{message_body}
<?php /* MOD - Show smilies in inbox/outbox by MS - end */ ?>
BTW, remove the comments if you don't want them. I just like to know as much as possible what code has been changed from the original.
The last place that needs to be fixed is displaying smilies in the message history. If anybody does this please post the fix back here. I haven't had time to do it yet. View Comments & Reply...
This is my first mod.
I thought the existing AJAX username check was very nice by telling someone if a username was already taken when they enter it.
However, I thought it would be even better if it also checked against your custom banned usernames as well.
So this is what I did (vldpersonals 2.5.3):
Edit, hp.checkusername.php in /includes/hp
add on line 80 (just after existing username check):
//------------------------------------------------
// Check if username is banned - MOD BY MS
//------------------------------------------------
$usernames = array_map('trim', explode("\n", $PREFS->conf['banned_usernames']));
if ( in_array($username, $usernames) )
{
die("error\n".$LANG['register']['username_taken']);
}
I have decided (for the moment) to show the same error message as if it was taken, but you may decide to make another message.
Enjoy! View Comments & Reply...






Latest Comments
Status Mod - To Keep them Coming Back
1 day ago
Status Mod - To Keep them Coming Back
1 day ago
Edit to Picture-Zoom
1 day ago