The Arcive of vBulletin Modifications Site. |
|
Column count in Profile Details »»
|
|||||||||||||||||||||||||
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:
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>
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
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
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> |
|
#3
|
||||
|
||||
|
You need to use the query_first() method:
PHP Code:
|
|
#4
|
||||
|
||||
|
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
|
|
#5
|
||||
|
||||
|
Oops, sorry, you DO need the GROUP BY. Bring that back and it'll work.
|
|
#6
|
||||
|
||||
|
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 |
|
#7
|
||||
|
||||
|
Did you hear something?
|
|
#8
|
||||
|
||||
|
Huh?
Satan |
|
#9
|
||||
|
||||
|
*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 |
|
#10
|
||||
|
||||
|
You're welcome as always, Takara.
|
![]() |
|
|