Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
v3 Articles, How many Articles a user made (in postbit) Details »»
v3 Articles, How many Articles a user made (in postbit)
Version: 1.00, by Guy G Guy G is offline
Developer Last Online: Jan 2006 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 12-29-2004 Last Update: Never Installs: 7
 
No support by the author.

This is my first hack so please be nice to me :P
This is an addon for the v3Article hack which can be found HERE
Anyway, this hack will add a field in the postbit for how many articles a user has posted.

Specs:
Templates Edited:1
Queries added: 1 during new article post.
File Edits: 1
Tables Changed: 1
Installation Time: 3min

So, first of all open Article.php and find the following code:
PHP Code:
// insert new article
    
$DB_site->query("INSERT INTO " TABLE_PREFIX "article
    (articleid,title,firstpostid,categoryid,open,articleusername,articleuserid,dateline,iconid,articlehash)
    VALUES (NULL,'" 
addslashes($title) . "',
    0,
    
$c,
    
$open,
    '" 
addslashes($bbuserinfo['username']) . "',
    '
$bbuserinfo[userid]',
    " 
TIMENOW ",
    
$iconid,
    '" 
addslashes($posthash) . "')");
    
$newarticleid $DB_site->insert_id(); 
under it add:
PHP Code:
        $DB_site->query("UPDATE " TABLE_PREFIX "user 
        SET user_article_count = user_article_count+1 "
); 
Now run this query through PhpMyAdmin or something...
PHP Code:
ALTER TABLE vb3_user` ADD `user_article_count` INT(10) UNSIGNED DEFAULT '0' NOT NULL; 
note that "vb3" should be your table prefix!

now after you done that its time for template editing..
go to postbit_legacy (for me) and search for this line:
PHP Code:
$vbphrase[posts]:</span$post[posts]</div
directly under it add this(customize colors as you want..):
PHP Code:
<div class="postbit" align="left"">
                    <span style="
color#8B9DB0; font-weight: bold">Articles Written:</span> $post[user_article_count]</div> 
note: if you already created articles than it will not update your status, you will need to manually add the numbers to the ppl who posted articles.

Feel free to comment and enhance this hack by any way.

Thats it! your done Click Install! :]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-29-2004, 11:28 PM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't use this hack, but just wondering how did you call
PHP Code:
$post[user_article_count
without amending showthread.php ?

Also, instead of creating a new column in the user table, why not just query the article table for count(articleuserid) ?

Reply With Quote
  #3  
Old 12-29-2004, 11:33 PM
Guy G Guy G is offline
 
Join Date: Nov 2004
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1. $post[user_article_count] uses the existing array that the showthread.php uses, so all i had to do is echo it.. showthread.php already SELECT * from vb3_user ...

2.you could do that, but it would be better to have 1 additional query used whenever posting a new article than adding an additional query to showthread.php which is excuted alot more times, therfore better performance :]
Reply With Quote
  #4  
Old 12-30-2004, 12:07 AM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ic. Thanks for the clarification,Zorobz
Reply With Quote
  #5  
Old 12-30-2004, 09:03 AM
BarHopper BarHopper is offline
 
Join Date: Mar 2003
Posts: 178
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Im gonna defaintly use this, excellant. Also, on your screenshot, i see the boxes around the fields, in the postbit. How do you do that?
Reply With Quote
  #6  
Old 12-30-2004, 12:37 PM
Guy G Guy G is offline
 
Join Date: Nov 2004
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thats just part of the style...
Reply With Quote
  #7  
Old 12-30-2004, 10:15 PM
Guy G Guy G is offline
 
Join Date: Nov 2004
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Update hopefully coming soon...
Reply With Quote
  #8  
Old 01-03-2005, 10:02 AM
trackpads's Avatar
trackpads trackpads is offline
 
Join Date: Aug 2003
Location: Armyville
Posts: 1,074
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent, gonna use for sure!
Reply With Quote
  #9  
Old 01-11-2005, 04:58 AM
KTBleeding's Avatar
KTBleeding KTBleeding is offline
 
Join Date: Feb 2004
Location: Tooele, UT
Posts: 756
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Question: Is there an easy way to get this to link to all the articles submitted by the user? Rather than just listing how many they have posted, could it also link to them? Thanks.
Reply With Quote
  #10  
Old 01-13-2005, 06:38 PM
Guy G Guy G is offline
 
Join Date: Nov 2004
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KTBleeding
Question: Is there an easy way to get this to link to all the articles submitted by the user? Rather than just listing how many they have posted, could it also link to them? Thanks.
Possible of course...

Ill see what i can do.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06125 seconds
  • Memory Usage 2,307KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete