PDA

View Full Version : Need some help with a hack


05-12-2000, 06:49 AM
I am attempting to make a "Welcome Back, $username - Click Here For New Posts" hack to put on my main page. I created a file called welcome.php in the forums directory, then I was doing an include of the file on my main page. In theory, everything should have worked, but it didn't. Here is the code I have:


<?php

include("admin/config.php");
include("global.php");

$db=mysql_connect($servername,$dbusername,$dbpassw ord);
mysql_select_db($dbname);


// if user is know, then welcome
if ($bbusername!="") {
$username=$bbusername;
eval("\$welcometext = \"".gettemplate("welcometext")."\";");
eval("\$logincode = \"".gettemplate("logoutcode")."\";");
eval("\$newposts = \"".gettemplate("newposts")."\";");

} else {
eval("\$newposts = \"".gettemplate("todayposts")."\";");
eval("\$logincode = \"".gettemplate("logincode")."\";");
}

if (isset($categoryid)!=0 and $categoryid!=0) {
verifyid("category",$categoryid);
$selcategoryid=$categoryid;
$categoriesonly=1;
}

}

?>


As you can see, basically I just ripped the portion of code out of the vB index.php file. I know php like I know how to speak Hindi. Well, maybe a little better than that ;). I'm sure (If what I am trying to do is even possible in the first place) that it is a syntax error on my part.

Anybody have any advice? Or, has anyone already made a hack for this and have had it work successfully?

Thanks all!

{Edited by John to Put in code tags}

[Edited by John on 05-14-2000 at 09:34 PM]

05-12-2000, 07:30 AM
Looks to me like you have one too many brackets at the end of the code.. Try eliminating the last bracket.. }

05-12-2000, 07:38 AM
Thanks, but that needs to be there; I used the quote feature instead of the code feature, and apparently it took out some of the spaces.