vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vB Forum Counter v2.1 (https://vborg.vbsupport.ru/showthread.php?t=69971)

AnhTuanCool 10-01-2004 08:13 PM

Run this query:
[sql]ALTER TABLE `forum` CHANGE `views` `view` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL[/sql]
Open file ./includes/functions_forumlist.php

Find:
PHP Code:

    $forumfields 'forum.forumid, views, lastpost, lastposter, lastthread, lastthreadid, lasticonid, threadcount, replycount'

Replace with:
PHP Code:

    $forumfields 'forum.forumid, view, lastpost, lastposter, lastthread, lastthreadid, lasticonid, threadcount, replycount'

Save up.

Open forumdisplay.php

Find:
PHP Code:

// ############################### Forum counter by AnhTuanCool ###############################
if ($vboptions['forumviewslive'])
{
    
// doing it as they happen
    
$DB_site->shutdown_query("
        UPDATE " 
TABLE_PREFIX "forum
        SET views = views + 1
        WHERE forumid = " 
intval($foruminfo['forumid'])
    );
}
else
{
    
// or doing it once an hour
    
$DB_site->shutdown_query("
        INSERT INTO " 
TABLE_PREFIX "views (forumid)
        VALUES (" 
intval($foruminfo['forumid']) . ')'
    
);


Replace with:
PHP Code:

// ############################### Forum counter by AnhTuanCool ###############################
if ($vboptions['forumviewslive'])
{
    
// doing it as they happen
    
$DB_site->shutdown_query("
        UPDATE " 
TABLE_PREFIX "forum
        SET view = view + 1
        WHERE forumid = " 
intval($foruminfo['forumid'])
    );
}
else
{
    
// or doing it once an hour
    
$DB_site->shutdown_query("
        INSERT INTO " 
TABLE_PREFIX "view (forumid)
        VALUES (" 
intval($foruminfo['forumid']) . ')'
    
);


Save up

Open template forumhome_forumbit_level2_post
Find
PHP Code:

$forum[views

Replace with:
PHP Code:

$forum[view

Save up and problem solved :)

Holidazed 10-01-2004 09:55 PM

Sweet!! Thank you

royals 10-03-2004 02:45 AM

If someone has the main forum saved in their favorites, instead of the directory - will it count as a hit? they aren't actually clicking on the link - they are already in the forum.

AnhTuanCool 10-03-2004 02:49 AM

Everytime the file forumdisplay.php loaded, it will count as a hit.

Johnny 10-03-2004 04:02 AM

Quote:

Originally Posted by royals
If someone has the main forum saved in their favorites, instead of the directory - will it count as a hit? they aren't actually clicking on the link - they are already in the forum.

thats the whole point is to keep track on how many views your getting to that particular fourms. it basicly works the sameway with your showthread views counter works.

Holidazed 10-04-2004 01:58 PM

Since I installed this hack, I get a database error.
_________________________________
Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT forum.title AS forumtitle, thread.threadid, thread.title, thread.dateline,
thread.lastpost, pollid, open, thread.replycount, postusername, postuserid,
thread.lastposter, thread.dateline, views
FROM forum AS forum
INNER JOIN thread AS thread USING(forumid)
LEFT JOIN deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
WHERE FIND_IN_SET('16', forum.parentlist) AND
thread.lastpost > 1096689607 AND
thread.visible = 1 AND
deletionlog.primaryid IS NULL

mysql error: Column: 'views' in field list is ambiguous

mysql error number: 1052

AnhTuanCool 10-04-2004 07:59 PM

Hmm, where did you get that error report, bitg?

If it said column views is amibguous then you just change the name of the column and change some other things around so answer me the first question, I'll find out next for ya ;)

Holidazed 10-04-2004 08:08 PM

Quote:

Originally Posted by AnhTuanCOol
Hmm, where did you get that error report, bitg?

If it said column views is amibguous then you just change the name of the column and change some other things around so answer me the first question, I'll find out next for ya ;)

I do not know. it us happening from an unregistered user. It started after I installed this hack.

AnhTuanCool 10-04-2004 09:28 PM

Did you do the one update for your CMPS Portal?

Holidazed 10-04-2004 09:38 PM

Yes, but this error is coming from another site I work on that does not run the cmps.


All times are GMT. The time now is 12:47 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.01018 seconds
  • Memory Usage 1,756KB
  • 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
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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