PDA

View Full Version : [Re-release v2.2.0] Combined threads started + percent of total posts, plus more


JJR512
11-04-2001, 10:00 PM
I have taken the Total Threads Started hack by tubedogg and the User's Percentage of Total Posts hack by apfeifer and combined the instructions into one unified set. I have also combined into it some new code by myself that shows the user's percentage of total threads.

Please note that credit for this should go mostly to tubedogg and apfeifer, as they wrote the base hacks for this re-release. I only combined their instructions and modified code from both hacks to add new functionality to them.

afterlab
11-05-2001, 06:24 AM
Nice job there. Worked and installed easily on my 2.0.3. Hope to see more hacks from ya. Good luck! :)

dxb
11-05-2001, 10:24 AM
well done JJR512

Kengan
11-11-2001, 10:35 AM
Nice hack !! love it !

Lesane
11-14-2001, 03:19 PM
Thanks for this small but very cool hack, installed the hack in a minute.

Lesane
11-16-2001, 06:42 AM
Since i installed this hack i receive errors when i try 2 view a user with an ' in his username, like "Tha' Anarchist", i receive this error:

Database error in vBulletin: Invalid SQL: SELECT COUNT(title) AS starts FROM thread WHERE postusername='Tha' Anarchist' AND open!='10'
mysql error: You have an error in your SQL syntax near 'Anarchist' AND open!='10'' at line 1
mysql error number: 1064
Date: Thursday 15th of November 2001 01:45:21 PM
Script: /board/member.php?s=&action=getinfo&userid=117

So when poeple have a ' in their username then i cant view their profile

I changed his username to "Tha Anarchist" and it works now fine but what can i do against this error?

JJR512
11-16-2001, 07:04 AM
I've experienced the same problem, although I didn't know it was related to this hack. Can you confirm that you never had this problem before this hack?

If this hack is the problem, I have no idea how to fix it. As I said in the hack instructions, this is mainly a combination of two separate hacks from two separate members, with a little derivatory add-on by myself.

Lesane
11-16-2001, 09:51 AM
Yes, after installing this hack i received alot of emails with the above error.

Can this be the problem:
In your instructions text file you say:

### Open member.php

### After That Add

// Find out how many threads this user has started
$startcount = $DB_site->query_first("SELECT COUNT(title) AS starts FROM thread WHERE postusername='$userinfo[username]' AND open!='10'");
$starts = $startcount[starts];
// end find threads started

Now i c you are using: postusername='$userinfo[username]'
what if i put there:
postusername='$bbuserinfo[userid]' ????

JJR512
11-16-2001, 01:51 PM
If you use postusername='$bbuserinfo[userid]', it won't work, because that would be asking it to find a name (postusername) where it equals a number (userid). Obviously, a name will never equal a number. But maybe if you could figure out how to change the left side of the equation to a number, like maybe postuserid, it would work. I don't know if there is such a thing as postuserid or not, so you'd have to try it and see (remember, I didn't write the original hack).

Brian Cruz
11-18-2001, 04:46 AM
There's a typo towards the end of the template code additon. It says {firstatltcolor} instead of {firstaltcolor} (extra "t" in "alt"). It caused that row to turn up bright green for me until I figured out the problem.

JJR512
11-18-2001, 12:07 PM
Thank you, I've updated the instruction file.

over
11-18-2001, 12:49 PM
nice hack :) very easy to install what else could we ask for :D

Brian Cruz
11-18-2001, 07:43 PM
I had a problem when I installed this hack. Whenever I tried to look at the profile of a member with an apostrophe in thier name, I would get an e-mail similar to this:

vBulletin (forum) Database error!

Database error in vBulletin 2.2.1:

Invalid SQL: SELECT COUNT(title) AS starts FROM thread WHERE postusername='Batman's bride' AND open!='10'
mysql error: You have an error in your SQL syntax near 's bride' AND open!='10'' at line 1

mysql error number: 1064

Date: Sunday 18th of November 2001 11:43:33 AM
Script: http://forums.toonzone.net/member.php?action=getinfo&userid=669
Referer:

In this case I tried to view the profile of a member named Batman's bride. I had to take the hack out for now. Can this be fixed?

SgtSling
11-19-2001, 02:43 AM
i am having the same problem with users with ' in ther name

JJR512
11-19-2001, 05:38 AM
As I said earlier, you'd have to ask the person that wrote that part of the hack. I believe that part of the code is from the hack by Tubedogg that counts how many threads a person has started. I would suggest finding that thread and asking in there.

Joshua Clinard
03-08-2002, 09:31 PM
I get a parse error on line 1155 in member.php when I click on a profile.

JJR512
03-08-2002, 10:20 PM
What is line 1155 in your member.php?

Wayne Luke
03-09-2002, 02:45 AM
Find the part where in that query where it says:

postusername='$userinfo[username]'


and change it to:

postusername='". addslashes($userinfo[username]) ."'

JJR512
03-09-2002, 02:57 AM
Thanks, I've updated the attachment. BTW, YGPM.

TheLink
07-31-2003, 11:01 PM
Does Wayne's change fix the errors everyone was receiving?

mfacer
11-14-2003, 06:51 AM
nice hack! installed v easily..! :)

*clicks install