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>
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>