PDA

View Full Version : Problem with a plugin for hiding forums


Demo16
03-06-2008, 11:11 AM
Hi guys,
I have 3.6.8 Patch Level 2.
This plugin hide/show forums for some languages but for some reason it doesn't works in my vb version (only in 3.6.5).
The problem is that when the plugin is enabled, I can see forums but I can't see threads inside them.

This is the xml code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="hide_language_specific" active="1">
<title>Hide language specific forums</title>
<description>Hide forums if they are not of user language</description>
<version>1.0</version>
<url>http:eeeeeeeee.com</url>
<versioncheckurl />
<dependencies>
</dependencies>
<codes>
<code version="1.0">
<installcode><![CDATA[$db->query_write("ALTER TABLE " . TABLE_PREFIX . "forum ADD langsnotallowed VARCHAR(250) DEFAULT '' NOT NULL");]]></installcode>
<uninstallcode><![CDATA[$db->query_write("ALTER TABLE " . TABLE_PREFIX . "forum DROP langsnotallowed ");]]></uninstallcode>
</code>
</codes>
<templates>
</templates>
<plugins>
<plugin active="1" executionorder="5">
<title>add Language option</title>
<hookname>forumadmin_edit_form</hookname>
<phpcode><![CDATA[$ldispp=$vbulletin->db->query_first("select langsnotallowed from ".TABLE_PREFIX."forum where forumid='".$vbulletin->GPC['forumid']."'");

print_table_header("Hide different language forums");
$ldispp=explode(',',$ldispp['langsnotallowed']);
$languages = $db->query_read("SELECT languageid,title FROM " . TABLE_PREFIX . "language ORDER BY languageid ASC");
while ($language = $db->fetch_array($languages))
{
$ldisabbp=true;
foreach($ldispp as $len){
if($len == $language['languageid'])
$ldisabbp=false;
}
print_yes_no_row("Show this forum for <b>$language[title]</b> language?<dfn>This setting allows $language[title] language users to view this forum.</dfn>", 'language'.$language['languageid'], $ldisabbp);

}
unset($language);
$db->free_result($languages);]]></phpcode>
</plugin>
<plugin active="1" executionorder="5">
<title>save Language option</title>
<hookname>forumadmin_update_save</hookname>
<phpcode><![CDATA[$lad=1;
$langsnotallowed='';
while(isset($_REQUEST['language'.$lad])){
if($_REQUEST['language'.$lad]== '0')
$langsnotallowed.="$lad,";
$lad++;
}

$vbulletin->db->query_write("update ".TABLE_PREFIX."forum set langsnotallowed='$langsnotallowed' where forumid='".$vbulletin->GPC['forumid']."'");]]></phpcode>
</plugin>
<plugin active="0" executionorder="5">
<title>hide language specific forums</title>
<hookname>parse_templates</hookname>
<phpcode><![CDATA[foreach($vbulletin->forumcache as $forumid => $forum){

if($forum['langsnotallowed']!=''){

$notallowedl=explode(',',$forum['langsnotallowed']);


if(in_array($vbulletin->userinfo['languageid'],$notallowedl)){

$vbulletin->userinfo['forumpermissions'][$forumid]='';
}


}

}]]></phpcode>
</plugin>
</plugins>
<phrases>
</phrases>
<options>
</options>
<helptopics>
</helptopics>
<cronentries>
</cronentries>
<faqentries>
</faqentries>
</product>

Marco van Herwaarden
03-06-2008, 11:21 AM
If you have questions/problems with a modification or style, then please post in the thread (or support forum/board) about that modification/style. Best chance to receive a reply from either the author or another member using the same modification/style.

Demo16
03-06-2008, 11:41 AM
This is a custom plugin Marco, where should I post?

Marco van Herwaarden
03-06-2008, 12:00 PM
Then this is the best place, even better would be to contact the author.

Demo16
03-06-2008, 12:04 PM
Then this is the best place, even better would be to contact the author.

I've request this plugin and I've paid for it but the author is "gone":o
The plugin works fine but I got this problem with the threads, any help would be appreciated

--------------- Added 1204885088 at 1204885088 ---------------

No help?

Demo16
03-08-2008, 10:42 AM
Up:D

Demo16
03-11-2008, 12:31 PM
Ok the problem seems to be witht PHP5, with PHP4 works well. No ideas?

Lynne
03-11-2008, 02:01 PM
Are you getting any errors logged in your error_log?

Demo16
03-11-2008, 02:31 PM
Where I can find the error log? Can you try this plugin? Is right here:http://www.dpcgamers.com/forum_it/product-hide_language_specific.xml

Lynne
03-11-2008, 05:31 PM
I don't have a 3.6.8 forum to try the plugin out on. I am not going to try it on my live site.

The error_logs are usually in your /home/yoursite/logs/ directory.

Demo16
03-11-2008, 06:02 PM
It's ok, the problem doesn't seems to be the vb version, but the php one. With php4 works well, with php5 it doesn't work.
Let me know if it works on your live site.

Dismounted
03-12-2008, 06:26 AM
I am not going to try it on my live site.
Did you read it properly? :p

You need to find your error log, as all PHP errors are recorded there.

Demo16
03-12-2008, 08:07 AM
Did you read it properly? :p

You need to find your error log, as all PHP errors are recorded there.
:D
Ok I'll try to find it and let you know.
But VB doesn't has any error log panel?

Dismounted
03-12-2008, 08:43 AM
As this is a PHP error, the errors would be in the PHP error log.

Demo16
03-19-2008, 10:06 AM
OK the problem is in the code, it doesn't work in any vbulletin. I've checked better. If I provide a fresh test installation can someone try to fix it?

Demo16
03-28-2008, 09:11 AM
No help at all?

Marco van Herwaarden
03-28-2008, 09:36 AM
It would be a lot easier to provide help once you can show us the exact errors that are logged.

Demo16
03-29-2008, 10:55 AM
I've solved the problem with a custom plugin made from a user, thank for all the support!