PDA

View Full Version : problems with functions.php


Snitz
05-23-2005, 05:34 PM
im testing this mod on my localhost...
all the files seems to be working fine exept functions.php
when I upload the edited functions.php the forum starts giving me a blank page
when I restore the old file, the forum works again!!!

I believe I did all the modifications just fine for that topic...
I donno what's happening!!

same thing goes to functions_showthread.php :\

sv1cec
05-23-2005, 06:07 PM
Not very specific. Where does it give you a blank page? The functions.php modification is just two things, replace the global declaration and add a section of code. Also, you need to create a new phrase. That's it. Where do you get the blank page?

And when you say "the same thing goes to functions_showthread.php" what do you mean? You also get a blank page? Where?

Rgds

Snitz
05-23-2005, 06:31 PM
when I replace functions_showthread.php, it starts giving me a blank page on showthread.php
and when I replace functions.php, it gives me a blank page on the whole forum.

I did create the new phrase you mentioned in ur instructions text!

sv1cec
05-23-2005, 07:09 PM
Check the changes again. The changes in functions.php affect only the case, when a banned member tries to log in the forum. There is no reason to get a blank page if the change was done properly.

If you can't find the problem yourself, maybe you can let me have a look.

Rgds

Snitz
05-23-2005, 07:13 PM
i'd be more than happen for you to have a look, but I found an error, it seems the mysql didn't install, coz when I went to "Execute Query" and ran the mysql code, it gave me the following

An error occurred while attempting to execute your query. The following information was returned.
error number: 1103
error desc: Incorrect table name '" . TABLE_PREFIX . "setting'

Marco van Herwaarden
05-23-2005, 08:00 PM
What editor did you use?

Snitz
05-23-2005, 08:08 PM
dreamweaver

why ? :confused:

Marco van Herwaarden
05-24-2005, 04:24 AM
Dreamweaver is known for causing problems like this. Tr re-edit your files with a normal text based editor.

Snitz
05-24-2005, 08:07 AM
i've been using dreamweaver since ever!!
never caused such problem :\
anyway I will try....

sv1cec, can you take a look at the code in my site plz?

sv1cec
05-24-2005, 08:10 AM
I can, but you'll have to give me ftp and admin access. Email me or PM me.

Also, in order to run the queries manually, you have to change the ".TABLE_PREFIX." part, to the table prefix you are using (if you are using one), or remove it all together, if you are not using a table prefix.

Rgds

Snitz
05-24-2005, 10:40 AM
I uploaded the files to my site, and everything worked just fine until I uploaded the modified functions.php, the forum started giving me a blank page... so I had to restore the old file.
and the functions_showthread.php. is working fine now.
I stopped at the funtions.php

just a question, should I edit the template files also so the php files work ???

and sv1cec pm sent, hope u can fix it!

and by the way, in modcp/banning.php, I couldn't find the following as you said in ur instructions text:
$DB_site->query("
UPDATE " . TABLE_PREFIX . "userban SET
adminid = $bbuserinfo[userid],
bandate = " . TIMENOW . ",
liftdate = $liftdate
WHERE userid = $user[userid]
");
but I found this which is very similar:
$DB_site->query("
UPDATE " . TABLE_PREFIX . "userban SET
adminid = $bbuserinfo[userid],
bandate = " . TIMENOW . ",
liftdate = $liftdate,
adminid = $bbuserinfo[userid]
WHERE userid = $user[userid]
");

the adminid is added twice :confused:
donno thought this might be the problem!

oh I just found something really interested:

15. This is not a mandatory change. Apply it, only if you want to display a special message to banned users who try to log in the forums. If the standard "You have no permission..." message is OK for you, do not apply this modification.

Open file includes/functions.php and find:

global $vboptions, $logincode, $url, $bbuserinfo, $session, $stylevar;

Replace that with:

global $DB_site, $vboptions, $logincode, $url, $bbuserinfo, $session, $stylevar;

Then find:

$bbuserinfo['badlocation'] = 1; // Used by exec_shut_down();

Right below that, add:

// Apply this for special message for banned users.
if (($bbuserinfo['usergroupid']==$vboptions['warn_banned_usergroup_id'] OR $bbuserinfo['usergroupid']==$vboptions['warn_troll_usergroup_id']) AND $bbuserinfo['userid'])
{
$ban = $DB_site->query_first("SELECT liftdate FROM " . TABLE_PREFIX . "userban WHERE userid=$bbuserinfo[userid]");
if ($ban['liftdate']=='0')
{
$until="permanently banned";
}
else
{
$until= vbdate ( $vboptions['dateformat'], $ban[liftdate] ) ;
$until=" temporarily banned, until the $until";
}
eval(print_standard_error('nopermission_banned', true));
}

what if im ok with the "You have no permission..." message, would it be ok not to modify functions.php. coz it's not working and causing probs in my forum!

sv1cec
05-24-2005, 04:56 PM
We'll make it work for you. But you are right, this is not a mandatory change. As I told you, I'll check your site either later tonight or early tomorrow morning. Please give me some time.

Rgds