This modification should work on all vBulletin versions starting at 3.5.1. Latest version tested on: 3.8.1.
Description
If you are using multiple languages on your forum, this hack will allow you to translate your forum titles into the different languages. You members will see the title in the language they have set in their UserCP, or the default title if no translation is given.
Install
1 minute job.
1 Product
Upload the contents of the 'upload' folder in the zip to your forumhome, and import the productfile.
Usage
You will find a new menu option in the Forums & Moderators menu group in your AdminCP after installation. No need for instructions to use this.
Screenshots
Screenshots added.
Changelog:
11-11-2005 v1.00
- Initial release
16-11-2005 v1.01
- Added support for translated forum descriptions
- Translations now updated when a forum is deleted.
For those with problems in combination with vBAdvanced (asuming your talking about recent threads on homepage), you could do the following quick fix. Actually this could be an adviced change for all who use vBa, if they use my hack or not, it will reduce the load on the database server a little.
In modules/latesttopics.php find:
PHP Code:
$threads = $db->query_read(" SELECT " . iif($mod_options['portal_threads_showrating'], 'IF(votenum >= ' . $vbulletin->options['showvotes'] . ', votenum, 0) AS numbvote, IF(votenum >= ' . $vbulletin->options['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . " thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid " . iif($mod_options['portal_threads_showsubscribed'] AND $vbulletin->userinfo['userid'], ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed') . iif($mod_options['portal_threads_showicon'], ', thread.iconid AS threadiconid, iconpath AS threadiconpath') . iif($mod_options['portal_threads_showforum'], ',thread.forumid, forum.title AS forumtitle') . iif ($mod_options['portal_threads_showpreview'] AND $vbulletin->options['threadpreview'], ', post.pagetext AS preview') . " FROM " . TABLE_PREFIX . "thread as thread " . iif($mod_options['portal_threads_showicon'], ' LEFT JOIN ' . TABLE_PREFIX . 'icon USING (iconid)') . iif($mod_options['portal_threads_showforum'], ' LEFT JOIN ' . TABLE_PREFIX . 'forum AS forum ON (thread.forumid = forum.forumid)') . iif($mod_options['portal_threads_showpreview'] AND $vbulletin->options['threadpreview'], ' LEFT JOIN ' . TABLE_PREFIX . 'post AS post ON (post.postid = thread.firstpostid)') . $deljoin . iif ($mod_options['portal_threads_showsubscribed'] AND $vbulletin->userinfo['userid'], ' LEFT JOIN ' . TABLE_PREFIX . 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = ' . $vbulletin->userinfo['userid'] . ')') . " WHERE open != 10 AND thread.visible = 1 $mods[threadids] $mods[inforums] $mods[exforums] $notdeleted ORDER BY $mod_options[portal_threads_orderby]$mod_options[portal_threads_direction] LIMIT $mod_options[portal_threads_maxthreads] ");
and REPLACE by:
PHP Code:
$threads = $db->query_read(" SELECT " . iif($mod_options['portal_threads_showrating'], 'IF(votenum >= ' . $vbulletin->options['showvotes'] . ', votenum, 0) AS numbvote, IF(votenum >= ' . $vbulletin->options['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . " thread.threadid, thread.forumid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid " . iif($mod_options['portal_threads_showsubscribed'] AND $vbulletin->userinfo['userid'], ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed') . iif($mod_options['portal_threads_showicon'], ', thread.iconid AS threadiconid, iconpath AS threadiconpath') . iif ($mod_options['portal_threads_showpreview'] AND $vbulletin->options['threadpreview'], ', post.pagetext AS preview') . " FROM " . TABLE_PREFIX . "thread as thread " . iif($mod_options['portal_threads_showicon'], ' LEFT JOIN ' . TABLE_PREFIX . 'icon USING (iconid)') . iif($mod_options['portal_threads_showpreview'] AND $vbulletin->options['threadpreview'], ' LEFT JOIN ' . TABLE_PREFIX . 'post AS post ON (post.postid = thread.firstpostid)') . $deljoin . iif ($mod_options['portal_threads_showsubscribed'] AND $vbulletin->userinfo['userid'], ' LEFT JOIN ' . TABLE_PREFIX . 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = ' . $vbulletin->userinfo['userid'] . ')') . " WHERE open != 10 AND thread.visible = 1 $mods[threadids] $mods[inforums] $mods[exforums] $notdeleted ORDER BY $mod_options[portal_threads_orderby]$mod_options[portal_threads_direction] LIMIT $mod_options[portal_threads_maxthreads] ");
Now find:
PHP Code:
$mods['threadcount'] = $db->num_rows($threads);
while ($thread = $db->fetch_array($threads)) { $bgclass = exec_switch_bg();
This will remove reading the forum title from the database. Instead it will be using the values that are already in the datastore (in memory, no query needed).
PS Someone could suggest this as a change in the standard vBa package since it is anyway an improvement.
Thank you so much Marco I'll take a look at it later today and let you know any feedback. Sorry I didn't get back earlier, I forgot to check the forum for a while.
Upgrade done, very easy and smart. Works great :up: :up:
Thank you very much Marco.
And if you can make the same with vb gallery and links to christmas you'll be my hero forever.
MarcoH64 Thanks for the hack.
My question is may you add a field to thread posting and user profile where the user can select which language they are posting in on posting or replying to a thread, and a user option where the user can select which languages they speak, like if the user chooses just german & english the user wont see french threads and if the user selects only french then they wont see the other ones