Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 13 Mar 2022, 13:58
Mot235 Mot235 is offline
 
Join Date: Aug 2020
Count number of search results

Hi is there a way for me to be about to count the number of search results returned from a searchJSON to pass into a variable that I can display to users.

I'm trying to do this as a way to display post counts each user has in a specific topic and this is where I am stuck.

Any help would be amazing.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So far I have been able to generate the search to pull every post a user has in a specific topic in this snippet.
Reply With Quote
  #2  
Old 13 Mar 2022, 17:39
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Real name: Ryan
Im not good with json, or vb4 for that matter, but I literally JUST finished making a product that one of the features is grabbing the count of post a user has made in a thread. So if its of any help, or gets you in the right direction take a look at this product for vb4 that is able to pull post count of a user in a thread (its what i just used as my vb3 base). hopefully it will help.

https://www.vbulletin.org/forum/showthread.php?t=285293
__________________
If you need custom work done please use Dirt RIF CustUmz
Owner of vBTeam
vBulletin 3.8.14 DRC Edition PHP 7.4 Compatible- NOT a null, NOT complete files Requires a legit copy of vBulletin 3.8.11.
Reply With Quote
  #3  
Old 13 Mar 2022, 17:51
Mot235 Mot235 is offline
 
Join Date: Aug 2020
Thanks, unfortunatly with vb5 they got rid of some of the critical pieces that made the old way this was done. One of them being in the admincp/misc.php as well as changing what a "thread" is and restructuring the forum so that its easier to store in the database without bogging it down.

https://vbulletin.org/forum/showthread.php?t=328571

Thats why I'm trying to find different ways to go about solving this. I appreciate the quick response tho.

--------------- Added 14 Mar 2022 at 02:06 ---------------

Owell you have inspired me tho I do need to get out of my comfort zone and try another strategy and get into building something more significant.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This should do the same thing essentially just gotta build off it

Last edited by Mot235; 14 Mar 2022 at 02:06.
Reply With Quote
  #4  
Old 14 Mar 2022, 09:08
delicjous's Avatar
delicjous delicjous is offline
 
Join Date: Nov 2014
I would do that directly in a new template and do a search via the API search, getInitialResults.
Then you get an array containing all the required values. Also the number of posts.

Just look at the templates for an example:
widget_blognodes
widget_search_results

..and use debugvardump to get dump of the array.

Edit: Your query is not taking care of any permission or closed status. The search will ...
__________________
ⓒ by delicjous
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Post Count Modifier - Minimum Post Characters to Count towards Post Count Chris M vBulletin 2.x Full Releases 35 13 Oct 2003 19:29



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 01:00.

Layout Options | Width: Wide Color: