View Full Version : Validating Link Error
nealparry
09-13-2004, 02:50 AM
Someone recently posted a link on my website and when I received the e-mail and then validated it via Admin CP, it didn't show their name on the main page, just 'Posted By BLANK'
Everything else appears to be working however as it should.
What do I need to do?
Brian
09-13-2004, 01:42 PM
In your functions_links.php file look for:
$username = $username["$key"];
Replace that with:
$mailusername = $username["$key"];
Then modify your 'adv_links_validation' phrase (under your 'Email Body Text' phrasegroup) and replace $username with $mailusername in that phrase.
socals
09-18-2004, 04:11 PM
What about in functions_links.php, a few lines down you have this code:
$extrafields = ", lastlinkid = '$key', lastposter = '" . addslashes($username["$key"]) . "', lastlinktitle = '" . addslashes(htmlspecialchars($name["$key"])) . "', lastuserid = '$userid[$key]', lastupdated = '$dateline[$key]'";
Which is still using $username["$key"] to write to the database? Wouldn't this need to be updated also?
I posted a message on this thread (http://www.vbadvanced.com/forum/showthread.php?t=2193) where I needed to fix the $extrafield so that the SQL query was correct.
I'm still learning PHP so I may be wrong, but I was able to fix this problem and haven't seen it since...
Brian
09-19-2004, 01:55 PM
The $username = $username["$key"] code is just getting the username for when it mails out the approval notification email. ;)
socals
09-19-2004, 03:41 PM
Yes, my bad... but this fix actually fixed my problem where the username was getting erased by the $username = $username["key"]. Now that it is $mailusername it no longer erases the by name on the last posted column. I backed out my fix and changed it with your fix and I don't get the erased name anymore.
I would think this would be a problem for everyone trying to moderate their links? The last posted by name is always blank.
Thanks for the proper fix though!
example of old bug:
nealparry
09-23-2004, 06:57 AM
that's great thanks.
There's two '$username = $username["$key"];' so I take it I change both in 'functions_links.php'?
Brian
09-23-2004, 01:13 PM
Sorry, I forgot that was in there twice. This is the one that needs to be changed:
construct_customfields_sql($key, false, true);
if ($sendmail["$key"] AND !empty($email["$key"]))
{
$username = $username["$key"];
nealparry
09-23-2004, 03:21 PM
oh right, i've actually changed both and it works fine. Am I best to do as you said though?
nealparry
09-23-2004, 03:25 PM
ignore my last, i've changed it to just the one adjustment.
Brian, I have yet to find a problem you haven't fixed. You are the man....the Barry Bonds of VbAdvanced!
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.