View Full Version : Mini Mods - Display Number (count) of Articles Posted by user in postbit
Simon Lloyd
12-06-2011, 11:00 PM
What this mod does
After installing this mod it will display the number of articles that a member has posted underneath "Posts:" in the postbit.
What this mod doesn't do (yet!)
This mod will not deduct from Article count when "Unpublishing", i will be working on this when time allows.
How to install
Simply download the product and install via AdminCp>Plugins & Products>Manage Products>Add/Install Product
The resources this mod uses
2 queries on install one of which may take quite some time on big boards
1 query when publishing an article
1 query when deleting an article
1 query on uninstall
Please mark as installed if you use this
Support will only be given to those that have marked it installed
__________________________________________________ ______________
Special Thanks to these people for helping me sort out my installation issues
Lynne
KH99
HMBeaty
Paul M
Version History
7th December 2011 Intial release ver1.0.0
8th Decmber 2011 Minor update, count is now clickable link to articles ver1.0.1
8th December 2011 minor change to fix my fixed url :)
When upgrading uninstall previous version first!!!
Simon Lloyd
12-07-2011, 08:41 AM
***reserved***
leejohn02
12-07-2011, 01:20 PM
is there a way to use this in the db postbit tabs, ie can u please release the code and what template its in so i can move it into dbtech postbit icons, thanks, and nice mod been looking for this
Simon Lloyd
12-07-2011, 03:58 PM
I have no idea what you mean by db postbit tabs!
KristerSwe
12-07-2011, 10:21 PM
Hi, installed it and shows in postbit, but is not count the articles i have already done? is show zero.
Maybe it counts the articles i made after the install ... ???
KristerSwe
12-07-2011, 10:24 PM
is there a way to use this in the db postbit tabs, ie can u please release the code and what template its in so i can move it into dbtech postbit icons, thanks, and nice mod been looking for this
you can use this code in DBT Postbilt tabmod but need to remove some doublepost from postbit template... am playing with it right now
<dt>{vb:rawphrase artcount}</dt><dd>{vb:raw $post['artcount']}{vb:raw artvar}</dd>
Dr.osamA
12-07-2011, 10:50 PM
installed
thank you bro , keep it up
Mr_Running
12-08-2011, 12:55 AM
but is not count the articles i have already done? is show zero.
Maybe it counts the articles i made after the install ... ???
Yes, confirm mine reads zero - 0 - too!
Also it would be an improvement if it linked to the articles.
Simon Lloyd
12-08-2011, 06:47 AM
you can use this code in DBT Postbilt tabmod but need to remove some doublepost from postbit template... am playing with it right now
<dt>{vb:rawphrase artcount}</dt><dd>{vb:raw $post['artcount']}{vb:raw artvar}</dd>Have you now got a count since you are trying to integrate it?
Yes, confirm mine reads zero - 0 - too!
Also it would be an improvement if it linked to the articles.I installed this on a live board and it DID count the articles on install, how did you create your articles? was it through the CMS or was it by promoting a post to article?, also it will only count articles if you haven't changed the prefix from Article to something else, the best way to check is to run this in your admincp>maintainance>execute query:
SELECT *
, COUNT(postusername) as count
FROM PREFIX_thread
WHERE title LIKE "Article:%"
AND postuserid =YOUR USERIDdon't forget to change PREFIX for your forum database prefix so it would read something like "vb_thread" (without the quotes), and dont forget to insert your userid inplace of YOUR USERID.
When you run the query you will get a single row table, at the far right of the table will be the count row where your total amount of threads that have the prefix "Article:" in front of them, let me know the result.
Mr_Running
12-08-2011, 11:31 AM
how did you create your articles?
Article was originally published in blog. (blog promoted to article)
I will try the execute query when I get to my computer. :)
KristerSwe
12-08-2011, 12:27 PM
My articles is made from CMS.. but i have table prefix "hd" so what should i do ..
thanks
Simon Lloyd
12-08-2011, 01:44 PM
Your table prefix shouldn't make a difference, if you mean your table is like this "hd_user" then you should be good, have you tried running the query i gave above?
Simon Lloyd
12-08-2011, 02:04 PM
I have just promoted a post/thread to article and the count increases :)
KristerSwe
12-08-2011, 02:57 PM
okey i tried this now and i this is my settings
SELECT *
, COUNT(postusername) as count
FROM hdthread
WHERE title LIKE "Article:%"
AND postuserid =1
and finded only 1 post of many i have made . sorry am not so familiar with all this ;)
Simon Lloyd
12-08-2011, 03:02 PM
....Also it would be an improvement if it linked to the articles.Will release this later tonight :)
Simon Lloyd
12-08-2011, 03:04 PM
okey i tried this now and i this is my settings
SELECT *
, COUNT(postusername) as count
FROM hdthread
WHERE title LIKE "Article:%"
AND postuserid =1
and finded only 1 post of many i have made . sorry am not so familiar with all this ;)Assuming you ARE userid 1 your query should have been thisSELECT *
, COUNT(postusername) as count
FROM hd_thread
WHERE title LIKE "Article:%"
AND postuserid =1run it and let me know the results :), remember it will only show you a single row so it will only be one post but im interested in the column on the far right!
Simon Lloyd
12-08-2011, 03:32 PM
Hey all, if you are upgrading you need to uninstall any previous version first :)
Mr_Running
12-08-2011, 05:44 PM
Excellent !
Note: I opened the xml to change the site to mine...may want to make a note to change. :)
Mr_Running
12-08-2011, 06:34 PM
Version 1.0.0 for dbtech tabs
you can use this code in DBT Postbilt tabmod but need to remove some doublepost from postbit template... am playing with it right now
<dt>{vb:rawphrase artcount}</dt><dd>{vb:raw $post['artcount']}{vb:raw artvar}</dd> oh and KristerSwe - I placed your code here in If I may suggest you may want to edit your post too. :)
Version 1.0.1
[CODE]<dt>{vb:rawphrase artcount}</dt><dd><a href="http://www.yoursite.com/list.php?author/{vb:raw artlink}">{vb:raw $post['artcount']}{vb:raw artvar}</a>
</dd>
Oh and the 1.0.1 xml as of right now needs to be edited to yoursite.
fixed :) in 1.0.2 xml
<dt>{vb:rawphrase artcount}</dt><dd><a href="./list.php?author/{vb:raw artlink}">{vb:raw $post['artcount']}{vb:raw artvar}</a>
</dd>
Simon Lloyd
12-08-2011, 07:17 PM
Excellent !
Note: I opened the xml to change the site to mine...may want to make a note to change. :)Fixed in new xml :) sorry about that, just rushed it out!
Simon Lloyd
12-08-2011, 07:18 PM
Version 1.0.1
<dt>{vb:rawphrase artcount}</dt><dd><a href="http://www.yoursite.com/list.php?author/{vb:raw artlink}">{vb:raw $post['artcount']}{vb:raw artvar}</a>
</dd>
Oh and the 1.0.1 xml as of right now needs to be edited to yoursite.This is fixed now :) Ver 1.0.2
Mr_Running
12-09-2011, 03:02 AM
If I wanted to hide the word "Articles" and the "number" from usergroups where would I edit? and if I wanted to move it? :)
Simon Lloyd
12-09-2011, 04:57 AM
You'd edit the template postbit_artcount and wrap the whole statement in that template in an IF condition like this <vb:if condition="!is_member_of($bbuserinfo, X, Y, Z)"><dt>{vb:rawphrase artcount}</dt><dd><a href="./list.php?author/{vb:raw artlink}">{vb:raw artvar}</a>
</dd></vb:ifSo now it will show to all usergroups except x,y & z
kpuls
12-13-2011, 03:20 PM
Thanks Simon!
Mr_Running
12-13-2011, 04:26 PM
Assuming you ARE userid 1 your query should have been thisSELECT *
, COUNT(postusername) as count
FROM hd_thread
WHERE title LIKE "Article:%"
AND postuserid =1run it and let me know the results :), remember it will only show you a single row so it will only be one post but im interested in the column on the far right!
An error occurred while attempting to execute your query. The following information was returned.
error number: 1146 error desc: Table 'xxxxxxxxxxxxxxx .hdthread' doesn't exist
Simon Lloyd
12-13-2011, 09:54 PM
That may be because you have run the query to look for hdthread when it's probably hd_thread
Simon Lloyd
12-13-2011, 09:55 PM
You're very welcome Kpuls, and thank you for allowing me to use www.excelguru.ca as a testing ground!
Mr_Running
12-14-2011, 01:51 AM
That may be because you have run the query to look for hdthread when it's probably hd_thread
Okay double checked
hd_thread
same error
Simon Lloyd
12-14-2011, 07:30 AM
Okay double checked
hd_thread
same errorPM Sent :)
Tri@de
06-18-2012, 09:17 AM
I installed on 4.2.
the strange thing is i see i made only 1 article.
There's a way to update (recount) articles maded?
Simon Lloyd
06-18-2012, 01:00 PM
Remove this line from the product xml$vbulletin->db->query_write(" ALTER TABLE " . TABLE_PREFIX . "user ADD artcount int(10) unsigned NOT NULL ");then re-import th eproduct and select overwrite.
Tri@de
06-18-2012, 01:45 PM
No way. i see only "1" but if i click on it i see all of them.
There's something with the language? I use italian language instead english.
Tri@de
06-18-2012, 02:14 PM
I solved modifying the query in this way:
$vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "user AS user
SET artcount = (SELECT COUNT(postusername) AS count
FROM thread
WHERE title LIKE 'Articolo:%'
AND postuserid = user.userid)
");
deverill2010
06-18-2012, 02:52 PM
I solved modifying the query in this way:
$vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "user AS user
SET artcount = (SELECT COUNT(postusername) AS count
FROM thread
WHERE title LIKE 'Articolo:%'
AND postuserid = user.userid)
");
that doesnt work for me either, I just have a 0 although I have clearly written loads of articles..
Tri@de
06-18-2012, 03:55 PM
It can't work for you if you don't use italian language.
Try replacing
'Articolo:%'
with
'Artic%'
Tri@de
06-22-2012, 07:41 AM
No way. Uninstalled.
It doesn't work properly.
Simon Lloyd
06-22-2012, 01:41 PM
What do you mean doesn't work properly?, it should work exactly as described.
Tri@de
06-22-2012, 02:39 PM
it count only some articles.
a user has displayed 8 but if i click on the number it displays 10 articles.
Seems that don't count older articles
Tri@de
06-22-2012, 03:08 PM
I found this looking in the db: some are called Artilces others "Discussion" as first word...
but i don't know why. the artilce settings are the same.
Simon Lloyd
06-22-2012, 05:30 PM
Well some could be unpublished, in moderation or not promoted to article :)
Tri@de
06-22-2012, 05:55 PM
no. there's not unpublished one.
i don't use moderation and post from forum.
Tri@de
06-22-2012, 06:04 PM
i forgot to tell that the problem is only when i install the product.
it doesn't count some of the older articles.
Simon Lloyd
06-22-2012, 08:02 PM
Ok, for you then, uninstall this mod completely and install this product it will look for Article: and Discussion:
As with ALL mod installations backup first :)
ForceHSS
01-10-2013, 08:52 PM
does this put any settings in options if so where
Simon Lloyd
01-10-2013, 10:19 PM
It's been that long since i created this i cant remember :) i dont think so though because all it does is add the template in the postbit.....i don't have time tonight but i'll check tomorrow and postback.
ForceHSS
01-12-2013, 11:46 AM
It's been that long since i created this i cant remember :) i dont think so though because all it does is add the template in the postbit.....i don't have time tonight but i'll check tomorrow and postback.
so did you look
Simon Lloyd
01-12-2013, 04:41 PM
Theres no settings in admincp
ForceHSS
01-12-2013, 05:36 PM
thanks
Muhammad Rahman
03-23-2014, 03:26 AM
how to show on member page
john7911
01-16-2015, 02:39 PM
Thank you ;)
Simon Lloyd
01-16-2015, 04:36 PM
You're welcome :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.