Jump to content

Im having a problem and I just cant seem to solve it.


Mancent

Recommended Posts

This is how it should look.

basic xml file

http://wiistream.net/php/user/pictures/gallery.xml

but this is how it looks.

http://wiistream.net/php/user/pictures/gallery.php?username=Mancent&user_folder=Mancent_Pictures

mysql php xml file with category's.

 

This is whats making it so hard the category's

Im using 3 tables one table is for my friends

and one table is the category folder name

and the other table is the picture holder with the category folder name

 

so I thought i could do a if statement

if user_folder = user_folder

 

from the two tables it would keep the correct images in the correct category.

But 3 weeks later still no luck.

 

Heres what I got so far.

<?php
//lets get the mysql connection information.
include "../../connect.php";
//we need this because the flash stores the xml file in temp internet history.
Header('Cache-Control: no-cache');
Header('Pragma: no-cache');
//ok flash sent out the username
$username = mysql_real_escape_string($_GET['username']);
//ok flash sent out the folder name
$user_folder = mysql_real_escape_string($_GET['user_folder']);

$user_folder = (isset($_GET['friend'])) ? ' AND b.user_folder = \'' . mysql_real_escape_string($_GET['user_folder']) . '\' ' : NULL;
//this part will be used becasue we need to see if friendship has ben made.
$friend = (isset($_GET['friend'])) ? ' AND b.friend = \'' . mysql_real_escape_string($_GET['friend']) . '\' ' : NULL;
//Ok lets select the username from the accounts table to see if they are a user..
$get_username = "SELECT * FROM accounts WHERE username = '$username'";
$username_results = mysql_query($get_username) or die("Data not found."); 
//Get the number of results from the query.
$check_username_mysql_rows = mysql_num_rows($username_results);




//If there is a match for the username, echo the the users xml data.
if($check_username_mysql_rows == 1) 
{

$sql1 = "SELECT a.username,a.user_folder,b.username FROM user_image_folders as a JOIN `user_friends_list` as b ON (b.friend = a.username)WHERE (b.username = '$username' $user_folder $friend AND b.status = 1)";
$result1 = mysql_query($sql1);


//TODO MAKE THE FRIENDSHIP WORK WITH THIS
$sql = "SELECT a.username,a.user_folder,a.user_folder,a.large_pic,a.small_pic,a.pic_title,a.pic_discription,b.username FROM user_photo_gallery as a JOIN `user_friends_list` as b ON (b.friend = a.username)WHERE (b.username = '$username' $user_folder $friend AND b.status = 1)";
$result2 = mysql_query($sql);


$user_xml = "<?xml version=\"1.0\"?>\n";
$user_xml .= "<settings>\n";
$user_xml .= "<sceneHeight>600</sceneHeight>\n";
$user_xml .= "<sceneWidth>1000</sceneWidth>\n";
$user_xml .= "<titleColor>#000000</titleColor>\n";
$user_xml .= "<descriptionBgAlpha>70</descriptionBgAlpha>\n";
$user_xml .= "<showFullscreenBtn>no</showFullscreenBtn>\n";
$user_xml .= "<waterMark useImage=\"no\"><![CDATA[THIS]]></waterMark>\n";
$user_xml .= "</settings>\n";
$user_xml .="<galleries>\n";

//{
while ($i_get_myfriends = mysql_fetch_assoc($result1))
{


$user_xml .="<gallery theName=\"". $i_get_myfriends['user_folder'] ."\" itemsPerRow=\"3\" autoStart=\"no\" playTime=\"5\" autoResize=\"yes\" xOffset=\"5\" yOffset=\"10\" showTitleOnThumbs=\"yes\" allowDownload=\"yes\">\n";



while ($i_get_myfriends2 = mysql_fetch_assoc($result2))
{
//if($i_get_myfriends['user_folder'] ==$i_get_myfriends2['user_folder'])
//{
$user_xml .="<picture largePicture=\"". $i_get_myfriends2['large_pic'] ."\" smallPicture=\"". $i_get_myfriends2['small_pic'] ."\" theTitle=\"". $i_get_myfriends2['pic_title'] ."\"><![CDATA[". $i_get_myfriends2['pic_discription'] ."]]>\n";
$user_xml .="</picture>\n";
//}
}




$user_xml .="</gallery>\n";
}


$user_xml .="</galleries>\n";
echo $user_xml; 
}
else
{
echo "Wiistream Eorror!\n";
}

?>

 

See all the images are going into one folder.. and they are sopost to go into the friends folder it they are the friends pictures.

 

but they are all in my folder..

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.