View Full Version : Problem when installing...
CrimsonGT
04-19-2005, 09:37 AM
Okay, I am a tad bit upset because I just bought my VBulletin forums and this was the first hack I chose to install. I get to the very end and I am almost done and everythings looking great then this happens...
2. MEMBERINFO TEMPLATE
In your MEMBERINFO template, find:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - $vbphrase[view_profile]: $userinfo[username]</title>
$headinclude
</head>
<body>
$header
$navbar
<!-- main info - avatar, profilepic etc. -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
and so on and so on, its a big block of code...
and then it says replace it with another big block. When I do this, I get the following error when I try to save it.
The following error occurred when attempting to evaluate this template:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/nightmar/public_html/forum/includes/adminfunctions_template.php(3096) : eval()'d code on line 132
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
Im so close to finishing and for some reason I am getting this error when I try and save the edited MEMBERINFO template...please help?
Marco van Herwaarden
04-19-2005, 09:51 AM
Double check your edit.
CrimsonGT
04-19-2005, 10:37 AM
Thanks, took me 4 times before I finally did it right. Its all installed and appears to work correctly except for one problem...
if you try to view a member's public profile, I get this...
Parse error: parse error, unexpected ')' in /home/nightmar/public_html/forum/member.php on line 625
and if you try to go to the private message area...
Parse error: parse error, unexpected T_ELSE in /home/nightmar/public_html/forum/private.php on line 949
Any idea why its doing that?
sv1cec
04-19-2005, 12:14 PM
Show me what you have about 10 lines before line 625 and 10 lines after in member.php.
Same thing with private.php, show me what you have a little before and a little after that line (949).
Rgds
CrimsonGT
04-19-2005, 05:01 PM
Is there anyway to determine what line you are looking at rather than counting from the top? I have usually just counted but 600 and 900+ are a long ways to count.
sv1cec
04-19-2005, 05:05 PM
For God's name, what editor are you using? Notepad? Please, do yourself a favor and don't use that crap.
Every decent editor should tell you, at which line you are at. Try downloading Crimson Editor or some other decent one.
Rgds
Notepad tells you what line you're on.
When you're on a line, do Edit > GoTo
or, View > Status Bar
:)
CrimsonGT
04-19-2005, 05:13 PM
in member...
// Shall we show the warn/view warns/view your warnings links?
if ($hierarchical==0)
{
if ($postadmin!=1 AND $postmod!=1 AND $postsmod!=1 AND ($useradmin==1 OR $usersmod==1 OR $usermod==1))
{
$showwarnlink=1;
$showviewwarnlink=1;
}
if ($userinfo[userid]==$bbuserinfo[userid] AND $useradmin!=1 AND $usersmod!=1 AND $usermod!=1 AND ($userinfo[warning_level]>0 OR $userinfo[warnings]>0 OR $userinfo[alerts]>0)))
{
$showviewyourslink=1;
}
}
if ($hierarchical==1)
{
if (($postadmin!=1 AND $postmod!=1 AND $postsmod!=1 AND ($useradmin==1 OR $usersmod==1 OR $usermod==1)) OR ($postmod==1 AND $usersmod==1) OR ($useradmin==1 AND $postadmin!=1))
{
$showwarnlink=1;
$showviewwarnlink=1;
}
if ($post[userid]==$bbuserinfo[userid] AND $postadmin!=1 AND ($post[warning_level]>0 OR $post[warnings]>0 OR $post[alerts]>0))
{
$showviewyourslink=1;
}
}
and in private...
if (!$collector=='' AND (vbstrtolower($recipient)==vbstrtolower($warner) OR vbstrtolower($recipient)==vbstrtolower($autowarner )))
{
$recipient=$collector;
if ($recipient != '')
{
$recipients["$recipient"] = addslashes(htmlspecialchars_uni($recipient));
}
}
}
// just a single user
else
{
if (!$collector=='' AND (vbstrtolower($pm['recipients'])==vbstrtolower($warner) OR vbstrtolower($pm['recipients'])==vbstrtolower($autowarner)))
{
$pm['recipients']=$collector;
}
$recipients[] = addslashes(htmlspecialchars_uni($pm['recipients']));
}
// query recipients
Thanks Jimps but I have been using wordpad, as notepad tends to make my code go to crap sometimes when I open or save a file. I just downloaded that Crimson Editor and its very nice, thanks for the link.
sv1cec
04-19-2005, 07:35 PM
In this line:
if ($userinfo[userid]==$bbuserinfo[userid] AND $useradmin!=1 AND $usersmod!=1 AND $usermod!=1 AND ($userinfo[warning_level]>0 OR $userinfo[warnings]>0 OR $userinfo[alerts]>0)))
delete one of the parenthesis at the end.
In private.php, find:
$recipient=$collector;
Add a } after that line.
Rgds
CrimsonGT
04-20-2005, 02:25 AM
Awesome, that fixed it, quick support too :nervous:
I found one more bug with it, New Thread doesn't work either.
the error-
Parse error: parse error, unexpected T_ELSE in /home/nightmar/public_html/forum/newthread.php on line 188
the block of code-
// End of automated warnings things
{
$url = "showthread.php?$session[sessionurl]p=$newpost[postid]#post$newpost[postid]";
}
else
{
$_REQUEST['forceredirect'] = 1;
$url = "forumdisplay.php?$session[sessionurl]f=$foruminfo[forumid]";
}
eval(print_standard_redirect('redirect_postthanks' ));
} // end if
}
The problematic line is where it says else, but I cant seem to find anything wrong with it?
sv1cec
04-20-2005, 03:37 AM
The error is not there, it is normally before that. You need to send me more code, to find it out.
Rgds
CrimsonGT
04-20-2005, 05:02 AM
build_new_post('thread', $foruminfo, array(), 0, $newpost, $errors);
if (sizeof($errors) > 0)
{
// ### POST HAS ERRORS ###
$postpreview = construct_errors($errors); // this will take the preview's place
construct_checkboxes($newpost);
$_REQUEST['do'] = 'newthread';
$newpost['message'] = htmlspecialchars_uni($newpost['message']);
}
else if ($newpost['preview'])
{
// ### PREVIEW POST ###
$postpreview = process_post_preview($newpost);
$_REQUEST['do'] = 'newthread';
$newpost['message'] = htmlspecialchars_uni($newpost['message']);
}
else
{
// ### NOT PREVIEW - ACTUAL POST ###
if ($newpost['postpoll'])
{
$url = "poll.php?$session[sessionurl]t=$newpost[threadid]&polloptions=$newpost[polloptions]";
}
else if ($newpost['visible'])
// Change for automatic warning
// You have to use "ObsceneWords" as Title of the Warning.
// You have to use a Hidden Warner.
if ($vboptions['warn_automatic'] == 1)
{
$Protected_Usergroups = explode("|",$vboptions['warn_protected_usergroups']);
if($Protected_Usergroups[0])
{
foreach($Protected_Usergroups as $pro)
{
if($pro == $bbuserinfo['usergroupid'])
{
$userprotected = 1;
}
}
}
if ($bbuserinfo['userid'] != 1 AND $userprotected != 1 AND $wehavecensoredwords == 1)
{
// Get Warning Types
$warn_type = array();
$warn_type = $DB_site->query_first("SELECT * FROM " . TABLE_PREFIX . "warning_types WHERE warn_name='ObsceneWords'");
$thread1="}/showthread.php?p={$newpost['postid']}']Warned Post ('{$vboptions['bburl')";
$thread2="$vboptions[bburl]/showthread.php?p=$newpost[postid]";
$warnerdata=$DB_site->query_first("select username, email from ".TABLE_PREFIX."user where userid='{$vboptions['warn_automatic_warner']}'");
$wcomment="(This is an automatic warning, no moderator was involved.)";
if ($alert=='')
{
$alert='No';
}
warn_calculations($warn_type['tid'], $wcomment, $newpost['postid'], $bbuserinfo, $vboptions['warn_automatic_warner'],$alert);
warn_notify($thread1, $thread2, $bbuserinfo, $warnerdata['email'], $warnerdata['username'], $vboptions['warn_automatic_warner'], $warn_type, $level, $wcomment, $alert);
}
}
// End of automated warnings things
{
$url = "showthread.php?$session[sessionurl]p=$newpost[postid]#post$newpost[postid]";
}
else
{
$_REQUEST['forceredirect'] = 1;
$url = "forumdisplay.php?$session[sessionurl]f=$foruminfo[forumid]";
}
eval(print_standard_redirect('redirect_postthanks' ));
} // end if
}
sv1cec
04-20-2005, 05:16 AM
Find this:
else if ($newpost['visible'])
// Change for automatic warning
// You have to use "ObsceneWords" as Title of the Warning.
// You have to use a Hidden Warner.
Replace with:
else if ($newpost['visible'])
{
// Change for automatic warning
// You have to use "ObsceneWords" as Title of the Warning.
// You have to use a Hidden Warner.
you missed a curly bracket { there.
Rgds
CrimsonGT
04-20-2005, 05:41 AM
Still getting the same error even after that. Im sorry I cannot do this for myself, I am an idiot :( Here is the updated code if you get a chance to take another look. I included a little bit more of the code this time.
if ($_POST['do'] == 'postthread')
{
globalize($_POST, array('posthash' => STR_NOHTML, 'poststarttime' => STR_NOHTML));
if (isset($_POST['WYSIWYG_HTML']))
{
require_once('./includes/functions_wysiwyg.php');
$newpost['message'] = convert_wysiwyg_html_to_bbcode($_POST['WYSIWYG_HTML'], $foruminfo['allowhtml']);
}
else
{
$newpost['message'] = &$_POST['message'];
}
if (!($forumperms & CANPOSTPOLL))
{
unset($_POST['postpoll']);
}
$newpost['title'] = $_POST['subject'];
$newpost['iconid'] = $_POST['iconid'];
$newpost['parseurl'] = $_POST['parseurl'];
$newpost['email'] = $_POST['email'];
$newpost['signature'] = $_POST['signature'];
$newpost['preview'] = $_POST['preview'];
$newpost['disablesmilies'] = $_POST['disablesmilies'];
$newpost['rating'] = $_POST['rating'];
$newpost['username'] = $_POST['username'];
$newpost['postpoll'] = $_POST['postpoll'];
$newpost['polloptions'] = intval($_POST['polloptions']);
$newpost['folderid'] = $_POST['folderid'];
$newpost['emailupdate'] = $_POST['emailupdate'];
$newpost['poststarttime'] = $poststarttime;
$newpost['posthash'] = $posthash;
// moderation options
$newpost['stickunstick'] = $_POST['stickunstick'];
$newpost['openclose'] = $_POST['openclose'];
build_new_post('thread', $foruminfo, array(), 0, $newpost, $errors);
if (sizeof($errors) > 0)
{
// ### POST HAS ERRORS ###
$postpreview = construct_errors($errors); // this will take the preview's place
construct_checkboxes($newpost);
$_REQUEST['do'] = 'newthread';
$newpost['message'] = htmlspecialchars_uni($newpost['message']);
}
else if ($newpost['preview'])
{
// ### PREVIEW POST ###
$postpreview = process_post_preview($newpost);
$_REQUEST['do'] = 'newthread';
$newpost['message'] = htmlspecialchars_uni($newpost['message']);
}
else
{
// ### NOT PREVIEW - ACTUAL POST ###
if ($newpost['postpoll'])
{
$url = "poll.php?$session[sessionurl]t=$newpost[threadid]&polloptions=$newpost[polloptions]";
}
else if ($newpost['visible'])
{
// Change for automatic warning
// You have to use "ObsceneWords" as Title of the Warning.
// You have to use a Hidden Warner.
if ($vboptions['warn_automatic'] == 1)
{
$Protected_Usergroups = explode("|",$vboptions['warn_protected_usergroups']);
if($Protected_Usergroups[0])
{
foreach($Protected_Usergroups as $pro)
{
if($pro == $bbuserinfo['usergroupid'])
{
$userprotected = 1;
}
}
}
if ($bbuserinfo['userid'] != 1 AND $userprotected != 1 AND $wehavecensoredwords == 1)
{
// Get Warning Types
$warn_type = array();
$warn_type = $DB_site->query_first("SELECT * FROM " . TABLE_PREFIX . "warning_types WHERE warn_name='ObsceneWords'");
$thread1="}/showthread.php?p={$newpost['postid']}']Warned Post ('{$vboptions['bburl')";
$thread2="$vboptions[bburl]/showthread.php?p=$newpost[postid]";
$warnerdata=$DB_site->query_first("select username, email from ".TABLE_PREFIX."user where userid='{$vboptions['warn_automatic_warner']}'");
$wcomment="(This is an automatic warning, no moderator was involved.)";
if ($alert=='')
{
$alert='No';
}
warn_calculations($warn_type['tid'], $wcomment, $newpost['postid'], $bbuserinfo, $vboptions['warn_automatic_warner'],$alert);
warn_notify($thread1, $thread2, $bbuserinfo, $warnerdata['email'], $warnerdata['username'], $vboptions['warn_automatic_warner'], $warn_type, $level, $wcomment, $alert);
}
}
// End of automated warnings things
{
$url = "showthread.php?$session[sessionurl]p=$newpost[postid]#post$newpost[postid]";
}
else
{
$_REQUEST['forceredirect'] = 1;
$url = "forumdisplay.php?$session[sessionurl]f=$foruminfo[forumid]";
}
eval(print_standard_redirect('redirect_postthanks' ));
} // end if
}
sv1cec
04-20-2005, 09:10 AM
Find this:
// End of automated warnings things
{
And delete that curly bracket {
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.