I haven't been on here for a while (Ramil and I had a disagreement/falling out - but we have since kissed and made up...only joking people!!!), I hope nobody missed me :D
Just thought I should post this interesting resource for anybody wanting to block those annoying Nigerian scammers (gee I would hate to be a normal, good person living in Nigeria - the internet must suck for them).
Please note, I haven't tested this, I am not sure how accurate the IP lists used are:
Block Nigerian Scammers From Apache Based Servers or Forums with a .htaccess Blocklist
Enjoy! View Comments & Reply...
The funny part was the opener.
It started with:
"How are you? i hope all is well with you,i saw your profil in (www.marry-an-ugly-millionaire-online-dating-agency.com)"
LMAO! I don't know if I should be happy or insulted by the suggestion that I have a profile on that site. What a niche!
What's more funny is the site does it exist. Check it out - fairly funny content - though doesn't appear to be a dating site.
Whats more is the domain seems to be owned by a fellow aussie:
domain: marry-an-ugly-millionaire-online-dating-agency.com
owner: RegistryWeb
organization: RegistryWeb
email: registrantwhois.registryweb.com
address: PO Box 334
address: -
city: Turramurra
state: NSW
postal-code: 2074
country: AU View Comments & Reply...
If you don't fill out a certain profile field - say Income, etc, then you can't see that field in another member's profile.
So if Im too lazy to answer why should I be able to see theirs etc.
Eg. If I'm too shy to reveal how poor I am (and not fill in the Income field in my profile), why should I be able to see other member's income.
Of course not just this field, but all fields that are left blank.
Instead of seeing their field value, it will say something like "As your {field name) is not filled out you can not see this member's {field name}" View Comments & Reply...
Google Health Advisory:
Don't get too carried away with PageRank - it is only one of MANY contributors to a good Google SE ranking.
I was very happy, and frankly very surprised to see one of my brand new sites go from PR0 to PR5. View Comments & Reply...
UnluckyInLove
their url on your site would be yoursite.com/UnluckyInLove/
but sometimes may be references places internally in vld as yoursite.com/member/98/ (where 98 is their member id)
This mod will help with seo rankings when members link to their profile like:
http://www.yoursite.com/unluckyinlove
or
HTTP://WWW.YOURSITE.COM/UNLUCKYINLOVE
or
http://www.yoursite.com/member/98/
Despite the "case" etc all these profiles URLs will currently resolve and show the correct profile (UnluckyInLove) - which is great, However for search engines who may crawl these links all of a sudden you will have a duplicate content problem. As search engines treat pages as case sensitive. Each variation of case after the domain is considered another page.
This simple mod solves this. (backup before any mod)
In lib.member_profile.php:
After:
$profile_obj = get_members_details($id, 1);
Add:
if ( $PREFS->conf['fancy_urls'] && $id != $profile_obj['member_username'] ) redirect(VIR_PATH . $profile_obj['member_username'] . "/" );
Now to make vld redirect SEO friendly.
In fns.misc.php:
Find the function redirect($url, $request_uri = 0) (should be at the top)
JUST above (important):
header("location: $url");
Add:
header ('HTTP/1.1 301 Moved Permanently');
So it should look like:
//------------------------------------------------
// Redirect user
//------------------------------------------------
function redirect($url, $request_uri = 0)
{
if ( $request_uri && isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] && isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] ) {
$_SESSION['REQUEST_URI'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
header ('HTTP/1.1 301 Moved Permanently');
header("location: $url");
exit;
}
// End function
Now the spiders will like the redirect, and spiders and all users who go to an incorrect "case" version of the link will be quickly redirected to the correct case. This doesn't improve usability, and would be mostly unnoticed to users, but it goes towards eliminating the chance of having duplicate member profiles that search engines hate.
So now:
http://www.yoursite.com/unluckyinlove
or
HTTP://WWW.YOURSITE.COM/UNLUCKYINLOVE
or
etc, etc, etc of all case variations
or
http://www.yoursite.com/member/98/
will all 301 redirect to the correct version:
http://www.yoursite.com/UnluckyInLove/
Of course if this member created their profile as
UNLUCKYINLOVE
All case variations will redirect to:
http://www.yoursite.com/UNLUCKYINLOVE/ View Comments & Reply...
Sometimes you may want to pass variables from a template to a language call:
Like have a string output:
"Welcome Idealists to VldCrowd.com! You can post up to 5 blog posts today."
Where:
Idealists is a username
VldCrowd.com is app_title
5 is some limit set somewhere (daily_blog_post_limit)
Currently it is not possible to do such language string manipulation within a tpl file itself.
All that is required for this example, is a language definition:
"vldcrowd_welcome_message" => //MOD
"Welcome %1% to %2%! You can post up to %3% blog posts today", //MOD
And then within the tpl file you would call the language string normally except now you pass the variables as such (variable 1 to 3, from left to right):
{lang:"custom","vldcrowd_welcome_message",session.username,settings.app_title, session.daily_blog_post_limit}
Only change is to replace (backup original ofcourse) the function vldext_lang within your ext.lang.php which is under /includes/ext/core with:
function vldext_lang ($mod, $key, $value1 = "", $value2 = "", $value3 = "")
{
global $LANG;
$language_string = isset($LANG[$mod][$key]) ? nl2br($LANG[$mod][$key]) : $key;
$variables = array("%1%", "%2%", "%3%");
$values = array("$value1","$value2","$value3");
$language_string = str_replace($variables, $values, $language_string);
return $language_string;
}
Also this will output the variable name instead of "Unknown field" if the field isn't found within the language definition. A bit more user friendly, and if you name your fields well, it should mean something to a user.
You can pass a max of 3 variables (if you know PHP you can easily increase it)
If you only need to pass 1 variable then it would be like:
{lang:"custom","vldcrowd_welcome_message",session.username}
If you don't need to pass variable it would be the same as old days, like:
{lang:"custom","vldcrowd_welcome_message"}
So no need to change all language calls. View Comments & Reply...
You could probably add Part 2 of this mod to member pictures and other member pages too, with no - or little modification.
Please backup, backup, backup. And test.. (I've only tested it a little).
Part 1 in lang.core.php AFTER "You cannot access this page.",
ADD:
"no_access_member_profile" => //MOD
"You cannot access this member's profile.", //MOD
Part 2 in lib.member_profile.php BEFORE " // Get connections " comment section, ADD:
//MOD START - PREVENT VIEWING PROFILE IF YOUR BLOCKED
//------------------------------------------------
// Get blocked
//------------------------------------------------
$result = $DB->query("SELECT blocked_id FROM " . DB_PREFIX . "blocked WHERE (blocked_id='" . $SESSION->conf['member_id'] . "' AND member_id='" . $profile_obj['member_id'] . "') LIMIT 1");
//------------------------------------------------
// Check if resultset contains any rows
//------------------------------------------------
if ($DB->num_rows($result))
{
$TEMPLATE->set_message("error", ($LANG['core']['no_access_member_profile']), 0, 0);
redirect(VIR_PATH);
}
//MOD END
Oh yeah, for this mod to work (as it is above), you will need to make sure you have included the message template on your homepage.tpl somewhere, like:
Enjoy View Comments & Reply...
Why? I dunno.. I just thought it maybe a good idea.
In lang.lib.account_blocked.php add somewhere after " $LANG['blocked'] = array ( ":
"You are not able to block this member.", //MOD
In lib.account_blocked.php BEFORE " // Insert blocked " comment section add:
$result = $DB->query("SELECT group_id FROM " . DB_PREFIX . "members WHERE member_id = '$id' AND group_id = 1 LIMIT 1");
if ($DB->num_rows($result)) {
$TEMPLATE->set_message("error", ($LANG['blocked']['cant_block_member']), 0, 0);
redirect(VIR_PATH . ($PREFS->conf['fancy_urls'] ? "member/$id/" : "index.php?m=member_profile&p=profile&id=$id"));
}
//MOD END
Please note, re: group_id = 1
where 1 is your admin group's id (if it is something different change the number) View Comments & Reply...
Currently (at least in 2.5.3) if:
Member A adds Member B as friend
Member B comes and adds Member A as friend (not by accepting existing request from Member A)
Member B gets a message saying "you have already added this member" when in fact they haven't - Member A did the adding before.
This mod changes the above to:
Member A adds Member B as friend
Member B comes and adds Member A as friend (not accepts existing request from Member A
Member A and Member B are now friends and live happily ever after.
The mod:
In lib.account.friends.php
Find:
Replace with:
$result = $DB->query("SELECT friend_id, member_id, request_date, pending FROM " . DB_PREFIX . "friends WHERE ( (friend_id='$id' AND member_id='" . $SESSION->conf['member_id'] . "') OR (member_id='$id' AND friend_id='" . $SESSION->conf['member_id'] . "') ) LIMIT 1"); //MOD
Find:
Add after:
//MOD START
if ( $obj->member_id == $id) {
redirect(VIR_PATH . ($PREFS->conf['fancy_urls'] ? "account/friends/accept/$id/" : "index.php?m=account_friends&p=accept&id==$id"));
}
//MOD END
And that is it! View Comments & Reply...





Latest Comments
Looking for Developer - VLD Site Mods and Fixes - Paid Job
about 9 hours ago
Looking for Developer - VLD Site Mods and Fixes - Paid Job
about 18 hours ago
Looking for Developer - VLD Site Mods and Fixes - Paid Job
about 20 hours ago