Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Column count in Profile Details »»
Column count in Profile
Version: , by Takara Takara is offline
Developer Last Online: Oct 2009 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 06-08-2002 Last Update: Never Installs: 0
 
No support by the author.

Im trying to use some stuff that FireFly did before to add the number of times a user made a new thread in a certin amount of forums (they work as columns).

Inside of members.php I added the following
PHP Code:
   // get the total number of columns posted
  
$columns=$DB_site->query("SELECT postuserid,count(*) AS totalcolumns FROM thread WHERE forumid IN (25,26,27,28,29,30,31) AND postuserid = $userid GROUP BY postuserid");
   if (!isset(
$columns[totalcolumns])) {
     
$total_columns="";
   } else {
    eval(
"\$total_columns = \"".gettemplate("column_total")."\";");
   } 
Thats near the bottem, then of course I have a template column_total, it simply reads
Code:
<tr>
	<td bgcolor="{firstaltcolor}"><normalfont><b>Total <a href="forumdisplay.php?s=$session[sessionhash]&forumid=24">Columns</a>:</b></normalfont></td>
	<td bgcolor="{firstaltcolor}"><normalfont>$columns[totalcolumns]</normalfont></td>
</tr>
And then inside my getinfo template I put $total_columns right after the 'Total Posts:' part. Thing is, it always returns as not set (I know because I assigned a value where it says $total_columns=""; )
Im assuming the problem is that $userid isnt right, I also tried $user[userid]. How can I get the userid of the profile that is being requested?

Thanks :bunny:

Show Your Support

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

Comments
  #2  
Old 06-08-2002, 10:10 AM
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Location: :bunny:
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, well. $userid is right, I just made sure. So it must be my query then? But it works when I try it via mysql
Code:
mysql> SELECT postuserid,count(*) AS totalcolumns FROM thread WHERE forumid IN (25,26,27,28,29,30,31) AND postuserid = 4 GROUP BY postuserid         -> ;
+------------+--------------+
| postuserid | totalcolumns |
+------------+--------------+
|          4 |            3 |
+------------+--------------+
1 row in set (0.00 sec)

mysql>
What am I doing wrong >_<
Reply With Quote
  #3  
Old 06-08-2002, 11:26 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to use the query_first() method:
PHP Code:
$columns=$DB_site->query_first("SELECT postuserid,count(*) AS totalcolumns FROM thread WHERE forumid IN (25,26,27,28,29,30,31) AND postuserid = $userid"); 
(And also don't need the GROUP BY clause)
Reply With Quote
  #4  
Old 06-08-2002, 12:04 PM
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Location: :bunny:
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hehe, thanks FireFly.

If I dont add the order by I get this icky error
Invalid SQL: SELECT postuserid,count(*) AS totalcolumns FROM thread WHERE forumid IN (25,26,27,28,29,30,31) AND postuserid = 4
mysql error: Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause

Thanks for the help again
Reply With Quote
  #5  
Old 06-08-2002, 02:45 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oops, sorry, you DO need the GROUP BY. Bring that back and it'll work.
Reply With Quote
  #6  
Old 06-08-2002, 03:18 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Chen...

How would I remove these Queries?

INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorde r) VALUES (NULL,26,'Admin Maximum Width','amw','100','Maximum width (in pixels) that the custom avatar image can be for admins.','','6')

INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorde r) VALUES (NULL,26,'Admin Maximum Height','amh','100','Maximum height (in pixels) that the custom avatar image can be for admins.','','6')

INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorde r) VALUES (NULL,26,'Admin Maximum File Size','amfs','20000','The maximum file size of admins (in bytes) that an avatar can be.','','6')

?

Using the SQL Query in Admin CP hack...

Satan
Reply With Quote
  #7  
Old 06-08-2002, 03:33 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you hear something?
Reply With Quote
  #8  
Old 06-08-2002, 04:38 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Huh?

Satan
Reply With Quote
  #9  
Old 06-08-2002, 08:59 PM
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Location: :bunny:
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*explodes from confusion*

Hey firefly, I would seriously like to thank you for all your help. I'm usually able to code most of what I want to do, but my coding is always messy, and half the time I dont even know what I'm doing. You're always here when I need a little bit of my code corrected.

Thanks very much

/me goes back to coding her messy code
Reply With Quote
  #10  
Old 06-09-2002, 05:25 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're welcome as always, Takara.
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 07:06 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.04876 seconds
  • Memory Usage 2,294KB
  • 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
  • (2)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete