|
Joined: Dec 2002
Posts: 67
Power User
|
Power User
Joined: Dec 2002
Posts: 67 |
Hi kids, I had several mods that don't port over from 6.5 to 7 and I'm working on getting them going. One that I wanted was the custom group icons under a user's name in showflat (I never use showthreaded). Here's where I am so far: In showflat.inc.php, changed this (around line 631): $query = " SELECT t1.POST_ID,t2.USER_DISPLAY_NAME,t1.POST_POSTED_TIME,t1.POST_POSTER_IP,t1.POST_SUBJECT,t1.POST_BODY,t1.POST_IS_APPROVED,t3.USER_AVATAR,t3.USER_TITLE,t3.USER_NAME_COLOR,t1.POST_ICON,t1.POST_HAS_POLL,t1.POST_HAS_FILE,t1.POST_PARENT_ID,t2.USER_MEMBERSHIP_LEVEL,t3.USER_SIGNATURE,t1.POST_LAST_EDITED_TIME,t1.POST_LAST_EDITED_BY,t3.USER_LOCATION,t3.USER_TOTAL_POSTS,t2.USER_REGISTERED_ON,t3.USER_RATING,t3.USER_AVATAR_WIDTH,t3.USER_AVATAR_HEIGHT,t2.USER_ID,t1.POST_PARENT_USER_ID,t3.USER_BIRTHDAY,t3.USER_PUBLIC_BIRTHDAY,t1.POST_ADD_SIGNATURE,t3.USER_ACCEPT_PM,t3.USER_HOMEPAGE FROM {$config['TABLE_PREFIX']}POSTS AS t1, {$config['TABLE_PREFIX']}USERS AS t2, {$config['TABLE_PREFIX']}USER_PROFILE as t3 WHERE t1.TOPIC_ID = ? AND t1.USER_ID = t2.USER_ID AND t1.USER_ID = t3.USER_ID $Viewable ORDER BY POST_ID $Limit ";
to this: $query = " SELECT t1.POST_ID,t2.USER_DISPLAY_NAME,t1.POST_POSTED_TIME,t1.POST_POSTER_IP,t1.POST_SUBJECT,t1.POST_BODY,t1.POST_IS_APPROVED,t3.USER_AVATAR,t3.USER_TITLE,t3.USER_NAME_COLOR,t1.POST_ICON,t1.POST_HAS_POLL,t1.POST_HAS_FILE,t1.POST_PARENT_ID,t2.USER_MEMBERSHIP_LEVEL,t3.USER_SIGNATURE,t1.POST_LAST_EDITED_TIME,t1.POST_LAST_EDITED_BY,t3.USER_LOCATION,t3.USER_TOTAL_POSTS,t2.USER_REGISTERED_ON,t3.USER_RATING,t3.USER_AVATAR_WIDTH,t3.USER_AVATAR_HEIGHT,t2.USER_ID,t1.POST_PARENT_USER_ID,t3.USER_BIRTHDAY,t3.USER_PUBLIC_BIRTHDAY,t1.POST_ADD_SIGNATURE,t3.USER_ACCEPT_PM,t3.USER_HOMEPAGE,t4.GROUP_ID FROM {$config['TABLE_PREFIX']}POSTS AS t1, {$config['TABLE_PREFIX']}USERS AS t2, {$config['TABLE_PREFIX']}USER_PROFILE as t3, {$config['TABLE_PREFIX']}USER_GROUPS as t4 WHERE t1.TOPIC_ID = ? AND t1.USER_ID = t2.USER_ID AND t1.USER_ID = t3.USER_ID AND t1.USER_ID = t4.USER_ID $Viewable ORDER BY POST_ID $Limit ";
and after this (around line 679): $postrow[$i]['UserStatus'] = "";
I added this: $postrow[$i]['GroupId'] = "";
and then BEFORE this (around line 923): I added this: if (preg_match("/-5-/",$GroupId)) { $postrow[$i]['GroupName'] = "Premium"; $postrow[$i]['GroupPic'] = "<a href="http://www.hairtell.com/ubbthreads/premium.php"><img src="http://www.hairtell.com/forum/images/subscriber01.jpg" border="0"></a>"; } if (preg_match("/-6-/",$GroupId)) { $postrow[$i]['GroupName'] = "Pro"; $postrow[$i]['GroupPic'] = "<a href="http://www.hairtell.com/ubbthreads/premium.php"><img src="http://www.hairtell.com/forum/images/subscriber02.jpg" border="0"></a>"; }
And then in showflat.tpl after this (around line 101): {$postrow[post].Title} <br />
I added this: <!-- callie hack --> {$postrow[post].GroupPic} <br /> <!-- end callie hack -->
But it doesn't work because the groups arent in a string separated by "-", like in the 6.5 database. They are a sequence, inside ubbt_USER_GROUPS. When I ran this, it didn't seem to do anything, so I uncommented the line in showflat.inc.php: and what happened is, it printed the user's post once for each group they belonged to... so that if they belonged to 3, 5 and 7 it printed: UserGuy Hey this is my post! 3 UserGuy Hey this is my post! 5 UserGuy Hey this is my post! 7 So I'm kinda at a stopping point. Any suggestions from you smarties out there? =) Thx, Callie
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|