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)
-   -   How many threads and posts since your last visit! (https://vborg.vbsupport.ru/showthread.php?t=59583)

Reverend 01-11-2004 06:24 PM

For anyone that has installed the instructions_newthreads.txt version you might want to make a grammatical change to the phrase content

From this:

Code:

There have been {1} threads and {2} posts since your last visit!
To this:

Code:

There have been {2} posts in {1} threads since your last visit!

Linear Helix 01-11-2004 06:36 PM

This is what I have put in my globals.php, replacing what the original hack prescribed.

PHP Code:

// #############################################################################
// activity since last visit hack

$forumids array_keys($forumcache);
foreach(
$forumids AS $key => $value) {
    
$fperms = &$bbuserinfo['forumpermissions']["$forumid"];
    
$forum = &$forumcache["$forumid"];
    if (!(
$fperms CANVIEW) OR !($fperms CANSEARCH) OR !verify_forum_password($forumid$forum['password'], false)) {
        unset(
$forumids["$key"]);
    }


$getnewthread=$DB_site->query_first("
    SELECT COUNT(*) AS threads
    FROM " 
TABLE_PREFIX "thread
    WHERE lastpost IN(" 
implode(', '$forumids) . ") > '" $bbuserinfo['lastvisit'] . "'
    "
); 

$getnewpost=$DB_site->query_first("
    SELECT COUNT(*) AS posts
    FROM " 
TABLE_PREFIX "post
    WHERE dateline IN(" 
implode(', '$forumids) . ") > '" $bbuserinfo['lastvisit'] . "'
    "
); 

But I got a database error, so... I guess I can't figure it out. I'm used to php, but this is the first experience I've had with vB's scripts. What am I missing?

Gary King 01-11-2004 06:39 PM

Quote:

Originally Posted by Reverend
For anyone that has installed the instructions_newthreads.txt version you might want to make a grammatical change to the phrase content

From this:

Code:

There have been {1} threads and {2} posts since your last visit!
To this:

Code:

There have been {2} posts in {1} threads since your last visit!

What's the difference? :p

Gary King 01-11-2004 06:40 PM

Quote:

Originally Posted by Linear Helix
This is what I have put in my globals.php, replacing what the original hack prescribed.

PHP Code:

// #############################################################################
// activity since last visit hack

$forumids array_keys($forumcache);
foreach(
$forumids AS $key => $value) {
    
$fperms = &$bbuserinfo['forumpermissions']["$forumid"];
    
$forum = &$forumcache["$forumid"];
    if (!(
$fperms CANVIEW) OR !($fperms CANSEARCH) OR !verify_forum_password($forumid$forum['password'], false)) {
        unset(
$forumids["$key"]);
    }


$getnewthread=$DB_site->query_first("
    SELECT COUNT(*) AS threads
    FROM " 
TABLE_PREFIX "thread
    WHERE lastpost IN(" 
implode(', '$forumids) . ") > '" $bbuserinfo['lastvisit'] . "'
    "
); 

$getnewpost=$DB_site->query_first("
    SELECT COUNT(*) AS posts
    FROM " 
TABLE_PREFIX "post
    WHERE dateline IN(" 
implode(', '$forumids) . ") > '" $bbuserinfo['lastvisit'] . "'
    "
); 

But I got a database error, so... I guess I can't figure it out. I'm used to php, but this is the first experience I've had with vB's scripts. What am I missing?

What was the database error? If you can't see it, then go to View Source - it's in there :)

Linear Helix 01-11-2004 06:52 PM

Ah, I had not known that the HTML for the database error page would contain the error comment.

***

Database error in vBulletin 3.0.0 Release Candidate 2:

Invalid SQL:
SELECT COUNT(*) AS threads
FROM thread
WHERE lastpost IN() > '1068258593'

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') > '1068258593'' at line 3

mysql error number: 1064

***

Character entity. I'll see if I can fix that > crappage.

Gary King 01-11-2004 07:00 PM

Quote:

Originally Posted by Linear Helix
Ah, I had not known that the HTML for the database error page would contain the error comment.

***

Database error in vBulletin 3.0.0 Release Candidate 2:

Invalid SQL:
SELECT COUNT(*) AS threads
FROM thread
WHERE lastpost IN() > '1068258593'

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') > '1068258593'' at line 3

mysql error number: 1064

***

Character entity. I'll see if I can fix that > crappage.

Nah it's just like that in HTML, it's supposed to be >.

Anyways, I think you're missing the code from this post: https://vborg.vbsupport.ru/showpost....8&postcount=48

Linear Helix 01-11-2004 07:02 PM

Check the database error I posted. You're right, it probably isn't the gt that is messing up, but it's thereabouts.

I am not missing that code: it's right there at the beginning of the code block I posted.

Boofo 01-11-2004 07:03 PM

Quote:

Originally Posted by Reverend
For anyone that has installed the instructions_newthreads.txt version you might want to make a grammatical change to the phrase content

From this:

Code:

There have been {1} threads and {2} posts since your last visit!
To this:

Code:

There have been {2} posts in {1} threads since your last visit!

That won't work. What if they make 2 posts in a thread that isn't new? ;)

Reverend 01-11-2004 09:42 PM

Quote:

Originally Posted by Boofo
That won't work. What if they make 2 posts in a thread that isn't new? ;)

If they make 2 posts in thread which isn't new it will say
"There have been 2 posts in 1 threads since your last visit!"

If they make 3 posts in 2 threads that aren't new it will say
"There have been 3 posts in 2 threads since your last visit!"

So would you like to explain why you reckon that doesn't work. ????

Don't forget i'm using the first version of the hack which isn't specifically for "new" threads ;)

Reverend 01-11-2004 09:48 PM

Quote:

Originally Posted by Gary W
What's the difference? :p

I was merely pointing out that some people might want to change the grammar.

Geez,sorry for mentioning it. :devious:


All times are GMT. The time now is 11:21 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.01337 seconds
  • Memory Usage 1,772KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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