How to enable sig images

Forum
Last Post
Threads / Messages

StarGirl

Member
Member
Joined
Feb 23, 2012
Messages
45
Points
0
Mysidian Dollar
4,530
You know in your site settings, there's an option to turn on " Enable Alternate Friendly Signature BBCode". It says I need to change the .htaccess file to something that will make it work. So what exactly do I change in there? I see the file, I see the part that converts the links..

Also, I've tried to get user's avatars to show up on the profile.php page. I got it, but now users are shown twice, one after the other and I think some are mixed up. Can you help? [I have no programming experience, I simply copied the query and edited it]
Code:
	// We did not specify a user, so show the memberlist
	$article_title = "Memberlist";
	$article_content = "Here are all of the members of this site, sorted by registration date.<br /><br />";
    include("classes/class_pagination.php");
    include("css/pagination.css");
	$query = "SELECT * FROM {$prefix}users ORDER BY uid ASC";
	$stmt = $adopts->query($query);
	$rowsperpage = 15;
    $pagination = new Pagination($adopts, $query, $rowsperpage, "http://www.{$domain}{$scriptpath}/profile.php");
    $pagination->setPage($_GET[page]);

	$query = "SELECT * FROM {$prefix}users ORDER BY uid ASC LIMIT {$pagination->getLimit()},{$rowsperpage}";  
	$stmt = $adopts->query($query);

	while ($row = $stmt->fetchObject()){
		$status = cancp($row->usergroup);
        $star = ($status == "yes")?"<img src='icons/star-rating-full.png' border=0' width='15' length='15' /> ":"";
        
        $getavatar = "SELECT * FROM {$prefix}users_profile ORDER BY uid ASC LIMIT {$pagination->getLimit()},{$rowsperpage}";  
	$stmt2 = $adopts->query($getavatar);

	while ($avatarrow = $stmt2->fetchObject()){
		$article_content .= "<strong><a href='profile.php?user={$row->username}'>{$star}<img src='{$avatarrow->avatar}' width='25' length='25'>{$row->username}</a></strong><br />";
        }
	}

	$article_content .= "<br />{$pagination->showPage()}";

}
 
Last edited:
Well just get rid of these from your profile.php and you will find users showing up only once:

PHP:
    include("classes/class_pagination.php");    
    include("css/pagination.css");     
    $query = "SELECT * FROM {$prefix}users ORDER BY uid ASC";     
    $stmt = $adopts->query($query);     
    $rowsperpage = 15;     
    $pagination = new Pagination($adopts, $query, $rowsperpage, "http://www.{$domain}{$scriptpath}/profile.php");      
    $pagination->setPage($_GET[page]);
 
I already fixed the showing up twice problem by changing it to..
Code:
	// We did not specify a user, so show the memberlist
	$article_title = "Memberlist";
	$article_content = "Here are all of the members of this site, sorted by registration date.<br /><br />";
    include("classes/class_pagination.php");
    include("css/pagination.css");
	$query = "SELECT * FROM {$prefix}users ORDER BY uid ASC";
	$stmt = $adopts->query($query);
	$rowsperpage = 15;
    $pagination = new Pagination($adopts, $query, $rowsperpage, "http://{$domain}{$scriptpath}/profile.php");
    $pagination->setPage($_GET[page]);

	$query = "SELECT * FROM {$prefix}users ORDER BY uid ASC LIMIT {$pagination->getLimit()},{$rowsperpage}";  
	$stmt = $adopts->query($query);

	while ($row = $stmt->fetchObject()){
		$status = cancp($row->usergroup);
        $star = ($status == "yes")?"<img src='icons/star-rating-full.png' border=0' width='15' length='15' /> ":"";
        
        $getavatar = "SELECT * FROM {$prefix}users_profile ORDER BY uid ASC LIMIT {$pagination->getLimit()},{$rowsperpage}";  
	$stmt2 = $adopts->query($getavatar);

	while ($avatarrow = $stmt2->fetchObject()){
	$avatar = ($avatarrow->avatar);
	}
	
		$article_content .= "<strong><a href='profile.php?user={$row->username}'>{$star}<img src='{$avatar}' width='25' length='25'>{$row->username}</a></strong><br />";
	}
	$article_content .= "<br />{$pagination->showPage()}";

}

Now the users are shown once, all have avatars next to them, but all the avatars shown are the same, and that avatar is the one of the newest user (last one on the list).
 
I see, looks like you did not retrieve the avatars from database successfully. Since usergroup and avatar info are stored in separate database tables, you will need to use the JOIN feature for your mysql query. The new Mys v1.3.1 database engine makes it all easy, I will show you how it will work when the new version is released.
 
Join feature ? So you mean I put a JOIN in the query?
 
Last edited:
Well the JOIN keyword is used when you attempt to grab data from multiple database tables. The new script for Mys v1.3.1 will introduce a database class and a method called join() which makes things easier. I will show you an example later tonight after I return from classes.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top