vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Views & Replies Count in Last Post box (https://vborg.vbsupport.ru/showthread.php?t=97502)

Fenriz 10-04-2005 01:11 AM

Views & Replies Count in Last Post box
 
Hi! Is it possible to make the hack "Views & Replies Count in Last Post box" for the vBulletin 3.5? I have next working code for the 3.0.x:

--------------------------------------------------------------------------

In the includes/functions_forumlist.php find:

$show['lastpostinfo'] = (!$lastpostforum['password'] OR verify_forum_password($lastpostforum['forumid'], $lastpostforum['password'], false));

below that insert:

$tviews = $DB_site->query_first("SELECT views AS tviews, replycount AS treply FROM " . TABLE_PREFIX . "thread WHERE threadid = $lastpostinfo[lastthreadid]");
$forum[tviews] = $tviews['tviews'];
$forum[treply] = $tviews['treply'];

In the forumhome_lastpostby template find:

</div>
</if>

below that insert:

<div class="smallfont" align="$stylevar[center]">
views: $forum[tviews] | replies: $forum[treply]
</div>

Andreas 10-04-2005 01:13 AM

That is inefficient.
I'd strongly recommend to implement this another way.

Fenriz 10-04-2005 09:39 AM

1 Attachment(s)
This hack works great on my 3.0.9 board http://valhalla.ulver.com , but I need it to be ported to the 3.5 !

KirbyDE, could you help me to find the efficient way? :)

Andreas 10-04-2005 09:52 AM

Smth. like this could work:

cache_ordered_forums
PHP Code:

if (THIS_SCRIPT == 'forumdisplay' OR THIS_SCRIPT == 'index')
{
    
$tachyjoin .= " LEFT JOIN " TABLE_PREFIX "thread AS thread ON (thread.threadid=forum.lastthreadid)";
    
$counter_select str_replace(array(', lastpost'', lastposter'', replycount'), array(', forum.lastpost'', forum.lastposter'', forum.replycount'), $counter_select) . ", thread.views AS tviews, thread.replycount AS treplies";


forumbit_display
PHP Code:

$forum['tviews'] = vb_number_format($forum['tviews']));
$forum['treplies'] = vb_number_format($forum['treplies'])); 


Fenriz 10-04-2005 02:46 PM

KirbyDE, the first part works, but ..

Quote:

Originally Posted by KirbyDE
forumbit_display
PHP Code:

$forum['tviews'] = vb_number_format($forum['tviews']));
$forum['treplies'] = vb_number_format($forum['treplies'])); 


this second part of the code always calls for error:

Parse error: parse error, unexpected ')' in /home/.../includes/functions_forumlist.php(466) : eval()'d code on line 1

Fenriz 10-07-2005 02:28 AM

KirbyDE?

Andreas 10-07-2005 10:10 AM

Well, correct the wrong ) in both lines (as told in the error message) and it should work :)

Fenriz 10-07-2005 04:09 PM

Oh :) Thank you very much! Now it works perfect!

Fenriz 04-12-2006 07:48 PM

Andreas, in 3.5.4 this hack became buggy.

On my forum http://valhalla.ulver.com/index.php?langid=1 it doesn't show "views: | replies: " in several forums and shows wrong information about quantity in the most forums.

Could you give me a good advise about this code, please?


All times are GMT. The time now is 12:55 AM.

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.01452 seconds
  • Memory Usage 1,742KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete