Thread: Admin Members
View Single Post
(#23)
Old
build build is offline
Member
build is on a distinguished road
 
Posts: 86
Join Date: Mar 2006
Location: Uk
Default 04-20-2006, 10:52 AM

Quote:
Originally Posted by juven14
I was working on what you were requesting but just have ran out of time in my schedule. Have to start getting the apt ready for our new baby this week and have a few other commitments that will cut down on the time I spend in the forum for a few days.

Here is what I had at the last test. There is a problem with the second sSQL and I just didn't have time to look any further. Hopefully someone will spot my error or foolishness and finish this up.

administration/userimages.php (new file)
PHP Code:
require_once('includes/init.php');

$id=$_REQUEST['id'];

//select
$sSQL='SELECT id FROM '.PREFIX.'products WHERE owner='.$id;
$result=$db->query($sSQL);
while (
$row=$result->fetch())
{
    
//select
    
$sSQL2='SELECT * FROM '.PREFIX.'prodimages WHERE pid='.$row['id'];
    
$result2=$db->query($sSQL2);
    
$results = array();
    
$i=0;
    while (
$rs=$result2->fetch())
    {
        
$tmp = array(
            
'id' => $rs['id'],
            
'pid' =>$rs['pid'],
            
'title' => $rs['title'],
            
'image' => $rs['image'],
            );
        
$results[$i++] = $tmp;
    }    
}
$class_tpl->assign('results',$results);

$class_tpl->assign('body','userimages.tpl.php');
$class_tpl->display('layout.tpl.php');
userimages template - administration/templates/userimages.tpl.php (new file):
HTML Code:
{* User Images *} <table class="tableborder"> <tr> <th><img src="images/nav_m.gif" /> <strong>User Images</strong></th> </tr> <tr> <td></td> </tr> {foreach from=$results item=item} <tr> <td><a href="listinginfo.php?view={$item.pid}"><img src="../thumbs/small_{$item.image}" /></a><br />{$item.title}</td> </tr> {foreachelse} <tr> <td>This user has 0 images.</td> </tr> {/foreach} </table>
administration/users/userinfo.tpl.php:
HTML Code:
<a href="userimages.php?id={$member}">view user's images </a>
userinfo.php
PHP Code:
$class_tpl->assign('member',$member);
I think that was it. I had it calling 1 image from each listing before I realized I was doing it wrong, I tried this one time which left me with nothing. Maybe someone will look at my code in userimages.php and fix it.
Hi John

WOW did not know you was have little one
Oh Oh no time on here now John
Anyway I hope all goes well for you both.

John I have been having a go with the above
Two points

1) Where is the " userinfo.php"

2) Does it matter where in the scripts you put this code IE
administration/users/userinfo.tpl.php:


PHP Code:
<a href="userimages.php?id={$member}">view user's images </a>

Should that go in a certain place in that file?

3) Are you calling this from admin? if so what part.

I will test it some more then


Regards

John

Useing Developer
Reply With Quote