Previous Thread
Next Thread
Print Thread
Rate Thread
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):
PHP Code
// Cycle through the posts
$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:
PHP Code
 // Cycle through the posts
$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):
PHP Code
$postrow[$i]['UserStatus'] = ""; 
I added this:
PHP Code
// Callie Hack
$postrow[$i]['GroupId'] = "";
// end Callie Hack
and then BEFORE this (around line 923):
PHP Code
// ---------------------
// Is it their birthday?

I added this:
PHP Code
// callie hack group pic
// Figure out what to display based on their groups
if (preg_match("/-5-/",$GroupId)) { // adjust this group number if needed
$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)) { // adjust this group number if needed
$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>";
}
// test it $postrow[$i]['GroupPic'] =$GroupId;
// end callie hack group pic

And then in showflat.tpl after this (around line 101):
PHP Code
{$postrow[post].Title}
<
br />
I added this:
PHP Code
<!-- 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:
PHP Code
// test it $postrow[$i]['GroupPic'] =$GroupId; 
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

Sponsored Links
Entire Thread
Subject Posted By Posted
Checking user group for group icons in showflat Calpy 01/15/2007 6:08 AM
Re: Checking user group for group icons in showflat Calpy 01/17/2007 12:51 AM
Re: Checking user group for group icons in showflat AllenAyres 01/17/2007 2:32 AM
Re: Checking user group for group icons in showfla Calpy 01/17/2007 11:09 AM
Re: Checking user group for group icons in showfla Gizmo 01/17/2007 12:00 PM
Re: Checking user group for group icons in showfla AllenAyres 01/17/2007 4:06 PM
Re: Checking user group for group icons in showfla Gizmo 01/17/2007 4:27 PM
Re: Checking user group for group icons in showfla AllenAyres 01/17/2007 8:57 PM
Re: Checking user group for group icons in showfla Calpy 01/18/2007 12:01 AM
Re: Checking user group for group icons in showfla Gizmo 01/18/2007 4:42 AM
Re: Checking user group for group icons in showfla JoshPet 01/18/2007 5:38 AM
Re: Checking user group for group icons in showfla Calpy 01/25/2007 8:12 AM
Re: Checking user group for group icons in showfla JoshPet 01/26/2007 3:29 AM
Re: Checking user group for group icons in showfla Deejay23 01/26/2007 7:56 PM
Re: Checking user group for group icons in showfla Calpy 04/02/2007 3:40 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)