PDA

View Full Version : i have a problem with a special counter


dom' puiu
09-02-2004, 04:02 PM
I have the following problem:
in my forum i have a special counter. i want this counter to apper in the showthread section of the forum. but only at the users from some usergroups i set.
i modified the postbit template:
<if condition="in_array('$bbuserinfo[usergroupid]', $groupidul)">
$vboptions[spc_name]: $post[spc_posts]<br>
</if>

and in the phpinclude_start i have put this:

$groupidul=explode(", ",$vboptions['spc_forumid']);

but i get the following error:
Warning: in_array(): Wrong datatype for second argument in /home/virtual/site13/fst/var/www/html/forum/includes/functions_showthread.php(640) : eval()'d code on line 67

i know that it sais the $groupidul is not an array but i dont know why

nexialys
09-02-2004, 04:07 PM
because your $vboptions['spc_forumid'] is not an array in itself... that's all. you can't explode something that contain nothing.

dom' puiu
09-02-2004, 04:14 PM
i have changed functions_databuild.php this way:

$spc_forumid=explode(", ",$vboptions['spc_forumid']);
$spc_usergroupid=explode(", ",$vboptions['spc_usergroupid']);
if($vboptions['spc_status']==1 && in_array("$threadinfo[forumid]",$spc_forumid) && in_array("$bbuserinfo[usergroupid]",$spc_usergroupid)){

.............some code...............

}

and it works. it doesn't shows errors.

rake
09-02-2004, 04:41 PM
because your $vboptions['spc_forumid'] is not an array in itself... that's all. you can't explode something that contain nothing.

It needs to be a string, not an array. You're exploding a string, to get an array.


dom' puiu, does it work? vBulletin generally doesn't spit out errors if something doesn't work, it just shows blank pages.

Salut. ;)

dom' puiu
09-02-2004, 04:45 PM
no it doesn't works. it shows the forum. but on the top of the page it gives me that error.

and i don't get the picture.

Tigga
09-02-2004, 04:53 PM
You need to add $groupidul to the global variables section for your 'construct_postbit' function.

dom' puiu
09-02-2004, 05:28 PM
it works!!!!!!!!!! thanks!!