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)

The Keeper 01-10-2004 11:53 AM

Does it properly parse new threads and new posts yet? A new post in an old thread is not a new thread.

walkingthepath 01-10-2004 04:36 PM

Hack not working for me!! :( I've got VB 3.0 RC2

Gary King 01-10-2004 04:41 PM

Quote:

Originally Posted by walkingthepath
Hack not working for me!! :( I've got VB 3.0 RC2

What do you mean not working? What's the problem?

Gary King 01-10-2004 04:45 PM

Quote:

Originally Posted by The Keeper
Does it properly parse new threads and new posts yet? A new post in an old thread is not a new thread.

Download instructions_regular.txt :)

Reverend 01-10-2004 06:03 PM

Like Linear Helix mentioned earlier.
Is there anyway to make it so that the totals only show threads/posts forums that users have permission to view.

i.e if a member posts in a private forum,the total only goes up for other users that have permission to view it.

Would solve any possible complaints from members when the stats show new threads/posts have been made,but when they click on "new posts" the totals don't match.

BTW, clicks Install. ;)

feldon23 01-10-2004 07:57 PM

Reverend, that would require a very complex query.

Gary King 01-10-2004 08:21 PM

Quote:

Originally Posted by Reverend
Like Linear Helix mentioned earlier.
Is there anyway to make it so that the totals only show threads/posts forums that users have permission to view.

i.e if a member posts in a private forum,the total only goes up for other users that have permission to view it.

Would solve any possible complaints from members when the stats show new threads/posts have been made,but when they click on "new posts" the totals don't match.

BTW, clicks Install. ;)

Something like that probably wouldn't be worth it for the time and power it'll require for a query like that, I'm not too sure right now anyways on how exactly the query would be written out :)

M1th 01-10-2004 08:24 PM

Quote:

Originally Posted by Reverend
Like Linear Helix mentioned earlier.
Is there anyway to make it so that the totals only show threads/posts forums that users have permission to view.

i.e if a member posts in a private forum,the total only goes up for other users that have permission to view it.

Would solve any possible complaints from members when the stats show new threads/posts have been made,but when they click on "new posts" the totals don't match.

BTW, clicks Install. ;)

you can use something like this:


PHP Code:

     // to check permissions for different users in forums
     
$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))
             {
              
// get rid of the forumids that the user doesnt have permission to view
                 
unset($forumids["$key"]);
             }
         } 


Then you add (new threads count in this case) ,
PHP Code:

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

as the query.

Boofo 01-10-2004 08:35 PM

Can you show us the whole thing? ;)

M1th 01-10-2004 08:59 PM

Quote:

Originally Posted by Boofo
Can you show us the whole thing? ;)

an example (for getting count of new threads since last visit):

PHP Code:

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

You just do the same thing for the other query.

Havent tested it but it should work. :)

Boofo 01-10-2004 09:05 PM

Quote:

Originally Posted by M1th
an example (for getting count of new threads since last visit):

PHP Code:

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

You just to the same thing for the other query.

Havent tested it but it should work. :)

I was talking about the one where forums that the user is not allowed to access is included in the query. ;)

M1th 01-10-2004 09:07 PM

Quote:

Originally Posted by Boofo
I was talking about the one where forums that the user is not allowed to access is included in the query. ;)

well, look again.. I HAVE included it in the query. :P

IN(" . implode(', ', $forumids) . ")

Boofo 01-10-2004 09:12 PM

Shows you what I know, huh? ;)Any way to combine the 2 queries like that?

EDIT: That query had a syntax error in it somewhere. ;)

M1th 01-10-2004 09:48 PM

Quote:

Originally Posted by Boofo
Shows you what I know, huh? ;)Any way to combine the 2 queries like that?

EDIT: That query had a syntax error in it somewhere. ;)

where? Dont see anything wrong with it.. :/


And why would you want to combine those two? they are from two different table... You wont gain anything by joining them.

Boofo 01-10-2004 10:08 PM

Well, it wouldn't run. It gave me an error near lastpost IN.

Joining the queries will reduce it to one and save one query. ;)

Reverend 01-10-2004 10:24 PM

Quote:

Originally Posted by Gary W
Something like that probably wouldn't be worth it for the time and power it'll require for a query like that, I'm not too sure right now anyways on how exactly the query would be written out :)

No probs Gary.

M1th 01-10-2004 10:58 PM

Quote:

Originally Posted by Boofo
Well, it wouldn't run. It gave me an error near lastpost IN.

Joining the queries will reduce it to one and save one query. ;)

it will, but the process and execusion time would be about the same.

But then again, im a n00b and get things wrong most of the time... :p

Blackbeard 01-11-2004 01:30 PM

I have installed the regular file, how do i make the numbers bold so they stick out

Gary King 01-11-2004 03:04 PM

Quote:

Originally Posted by Blackbeard
I have installed the regular file, how do i make the numbers bold so they stick out

Find:
PHP Code:

    $show $memberstext.' '.strtolower($vbphrase['online']).': '.$regmemberson.'. '.$gueststext.' '.strtolower($vbphrase['online']).': '.$guestson.'.'

Replace with
PHP Code:

    $show $memberstext.' '.strtolower($vbphrase['online']).': <b>'.$regmemberson.'</b>. '.$gueststext.' '.strtolower($vbphrase['online']).': <b>'.$guestson.'</b>.'

That should do it :)

Linear Helix 01-11-2004 05:51 PM

Thanks, M1th. I haven't tried your stuff there yet, but I'm gonna check it out and make it work.

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() &gt; '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 ') &gt; '1068258593'' at line 3

mysql error number: 1064

***

Character entity. I'll see if I can fix that &gt; 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() &gt; '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 ') &gt; '1068258593'' at line 3

mysql error number: 1064

***

Character entity. I'll see if I can fix that &gt; 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:

Boofo 01-11-2004 09:50 PM

I would only use it with new posts AND new threads. Then it wouldn't work right. ;)

Gary King 01-11-2004 10:15 PM

Quote:

Originally Posted by Boofo
I would only use it with new posts AND new threads. Then it wouldn't work right. ;)

I'm not sure if you've noticed, but both those phrases would do the exact same thing only move things around :)

And to Reverend, I can't really see how either way would be "gramatically correct" :p

Reverend 01-11-2004 10:21 PM

Quote:

Originally Posted by Gary W
And to Reverend, I can't really see how either way would be "gramatically correct" :p

Did i say anything about the grammar being correct or incorrect. ????

Whatever ... :rolleyes: :D

Gary King 01-11-2004 11:00 PM

Quote:

Originally Posted by Reverend
Did i say anything about the grammar being correct or incorrect. ????

Whatever ... :rolleyes: :D

My mistake :rolleyes:

Tru Smiles 01-12-2004 05:20 PM

Err.. Am I just stupid or something, but what does it mean by 'Phrase'? Is it a query that has to be run or a new template? o_o

Gary King 01-12-2004 11:11 PM

Quote:

Originally Posted by Tru Smiles
Err.. Am I just stupid or something, but what does it mean by 'Phrase'? Is it a query that has to be run or a new template? o_o

Admin CP -> Languages & Phrases -> Phrase Manager

Tru Smiles 01-13-2004 01:42 PM

Thanks, I should have noticed that myself >_>;;

Text has come up, but the number of threads and posts ain't there - Is there something that has to be added for RC2?

Gary King 01-13-2004 08:21 PM

Quote:

Originally Posted by Tru Smiles
Thanks, I should have noticed that myself >_>;;

Text has come up, but the number of threads and posts ain't there - Is there something that has to be added for RC2?

Nope these instructions are for vB 3 RC 2, you probably missed a step.

Rampag33 01-13-2004 08:46 PM

Quote:

Originally Posted by Link14716
All you need is one phrase.

Just call it "home_sincelastvisit"
"There have been {1} threads and {2} posts since your last visit!"

Then use this in navbar:
Code:

<phrase 1="$getnewthread[threads]" 2="$getnewpost[posts]" />$vbphrase[home_sincelastvisit]</phrase>

Installs

Great job was looking for this.

Gary King 01-13-2004 09:05 PM

Quote:

Originally Posted by Rampag33
Installs

Great job was looking for this.

Already included in the instructions I believe :)


All times are GMT. The time now is 04:18 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.01706 seconds
  • Memory Usage 1,889KB
  • 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
  • (7)bbcode_code_printable
  • (8)bbcode_php_printable
  • (24)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
  • (40)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