PDA

View Full Version : Need suport - Can't get Hacks Creator to Help


JakeC
01-23-2003, 07:48 PM
Is anyone familiar with DrkFusion's Links database hack? It's quite nice but I am having trouble with it. He is too busy working on his next release in order help figure out what is going on with my hack installation.

Basically whenever I add an apostrophe to the Title or the description of the link; the link will not be added to the database. It does not show up for moderation and therefore I don't even see it. My users are getting a little frustrated when the link that they submit does not show up in the database. Someone else was having the same problem and I tried the fix that they used but my code was different than theirs and it was not a simple cut and paste operation. Anyone have any ideas? If I need to post any code let me know. Thanks in advance.

Jake

Boofo
01-23-2003, 08:04 PM
Paste just the part that is giving you trouble and I think it might just need an unhtmlcharacters in a place ot two.

JakeC
01-24-2003, 09:55 PM
I'm not too sure on how to do that. Could you be more specific?

Thanks

JakeC

Boofo
01-24-2003, 10:49 PM
Paste whatever part of the code that is giving you problems, in here, and I will see if I can figure out what is happening.

JakeC
01-24-2003, 11:57 PM
Here is the code that seems to be at the root of the problem:


// #################### Do Add New ####################
if ($HTTP_POST_VARS['action']=="doaddnew") {
if ($catid == '0'){
eval("dooutput(\"".gettemplate('drkslinks_error2')."\");");
}elseif ($linkname == ''){
eval("dooutput(\"".gettemplate('drkslinks_error2')."\");");
}elseif ($linkurl == 'http://' or $linkurl == ''){
eval("dooutput(\"".gettemplate('drkslinks_error2')."\");");
}elseif ($linkdesc == ''){
eval("dooutput(\"".gettemplate('drkslinks_error2')."\");");
}else{
if ($valid == '1'){
$vd = "0";
}else{
$vd = "1";
}
$result = mysql_query("INSERT INTO gportal_weblinkslink (catagoryid, linkname, linkurl, linkdesc, valid) VALUES ('$catid', '".addslashes(htmlspecialchars($linkname))."', '$linkurl', '$linkdesc', $vd)");
eval("dooutput(\"".gettemplate('drkslinks_doneaddlink')."\");");
}
}



Thanks in advance

JakeC

Boofo
01-25-2003, 01:21 AM
Try changing this:

$result = mysql_query("INSERT INTO gportal_weblinkslink (catagoryid, linkname, linkurl, linkdesc, valid) VALUES ('$catid', '".addslashes(htmlspecialchars($linkname))."', '$linkurl', '$linkdesc', $vd)");
eval("dooutput(\"".gettemplate('drkslinks_doneaddlink')."\");");

To this:

$result = mysql_query("INSERT INTO gportal_weblinkslink (catagoryid, linkname, linkurl, linkdesc, valid) VALUES ('$catid', '".addslashes($linkname)."', '$linkurl', '".addslashes($linkdesc)."', $vd)");
eval("dooutput(\"".gettemplate('drkslinks_doneaddlink')."\");");

and let me know what you get.

JakeC
01-25-2003, 01:44 AM
Still not working. It's working if the apostrophe is in the title but not the description.

JakeC

Boofo
01-25-2003, 01:53 AM
You might want to try it again. I changed the code above after I posted it. You might have tried the old code. Try what I have up there now and let me know.

JakeC
01-25-2003, 02:56 AM
Very cool! Thanks a bunch. Works like a charm. I appreciate it very much.

JakeC

Boofo
01-25-2003, 08:35 AM
You're very welcome. ;)