vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Forum Home Enhancements - Forum Title Language (https://vborg.vbsupport.ru/showthread.php?t=100589)

GrendelKhan{TSU 11-14-2005 12:05 AM

Quote:

Originally Posted by Ramsesx
Hm, sad I don't think Brian (vba) will rewrite his software only for that.
But now it's a first step and I am happy about it.

I'm in the same boat. ;)

still love to see integration though...either from the hack author end or the vba end....whichever comes first. :p

Marco van Herwaarden 11-15-2005 10:44 AM

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(); 

Add Under:
PHP Code:

            // MarcoH64
            
if ($mod_options['portal_threads_showforum'])
            {
                
$thread['forumtitle'] = $vbulletin->datastore->registry->forumcache["$thread[forumid]"]['title_clean'];
            }
            
// /MarcoH64 

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.

Marco van Herwaarden 11-15-2005 10:45 AM

PS Next version with also translated descriptions is ready, will pack it up this afternoon if i have time.

divisortheory 11-15-2005 01:48 PM

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.

Marco van Herwaarden 11-16-2005 06:44 AM

Version 1.01 released:
16-11-2005 v1.01
- Added support for translated forum descriptions
- Translations now updated when a forum is deleted.

Ramsesx 11-16-2005 01:32 PM

Great news, thank you marco, what's the best way to upgrade, uninstall the old xml file?

Marco van Herwaarden 11-16-2005 02:03 PM

Just install with Allow Overwrite set to Yes. It will upgrade nicely (i hope :D )

Ramsesx 11-17-2005 01:35 AM

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. :)

Marco van Herwaarden 11-17-2005 05:41 AM

Post links to the hacks you want to have modified and i will see what i can do.

PS I don't plan to go make modifications to all hacks that don't use standard vB caching.

AxEsLoCkEd 11-18-2005 03:27 PM

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


All times are GMT. The time now is 11:57 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01248 seconds
  • Memory Usage 1,795KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete