Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Please Help me
garwil
Junior Member

Posts: 4
Registered: 6/26/2007
Location: Durban
Member Is Offline
posted on 6/26/2007 at 07:45 AM Reply With Quote
Please Help me


Hi,
I have inherited an application that allows my users to upload images to a folder and mysql. As a newbie and trying to learn this I have spent five days trying to figure the code out but alas have fallen short
The issue is this...
All users uploads their images to a single folder. The images are renamed as 20.jpg, 21.jpg etc and are auto-incremented so when a user changes an image the name also changes. The database on the other hand only lists an id and venueid which has the same name as the image in the images folder but without the file extension. For me it is difficult to match the db and images together as the php files created to manage this are complicated.
In the page that actually displays the images all I have is a reference to one of the other pages as such -- makegallery( $files, 5, 0, 80, 50); .
So, to cap it all off I have these files created.
1. uploadimage.php
2. makepicfit.php
3. makegallery.php
4. showvenue.php

I won't post all the script here as it is too long but if there is someone out there able to help me integrate this into tigra_hints I would be very grateful.I will then either post or send the files in question..
I have tried to extract the actual files names from an array and tried the solution in thread 4102 but can't get it to work for me.
any takers?

Best regards,
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 6/27/2007 at 05:39 AM Reply With Quote

Tigra Hints is the client side script - it works in the browser and it has no way of directly accessing the database and directories on the server. You can add Tigra Hints to your application, but it will not replace your existing php scripts. Please submit a support ticket attaching your files if you want a quote for fixing your php code.
View User's Profile View All Posts By User U2U Member
garwil
Junior Member

Posts: 4
Registered: 6/26/2007
Location: Durban
Member Is Offline
posted on 6/27/2007 at 08:29 AM Reply With Quote

Thanks admin for the reply.
I was just hoping that someone could just show me a way to pull the actual file names from the array created in my own pages to be inserted into tigra hints .e.g

<img src="$pic1/>" width="100" onMouseOver="myHint2.show('tt1', this)" onMouseOut="myHint2.hide()" /> &nbsp;
<img src="$pic2/>" width="100" onMouseOver="myHint2.show('tt1', this)" onMouseOut="myHint2.hide()" /> &nbsp;

etc..
If this is not ppossible then I will certainly post a support script if all else fails

rgds

garwil
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 6/27/2007 at 04:04 PM Reply With Quote

if you want to print the value of PHP variable into the HTML stream you can do:
<img src="<? echo $pic1 ?>/>" width="100" ...
or
<img src="<?= $pic1 ?>/>" width="100" ...
if this is what you're trying to do
View User's Profile View All Posts By User U2U Member
garwil
Junior Member

Posts: 4
Registered: 6/26/2007
Location: Durban
Member Is Offline
posted on 6/28/2007 at 11:29 AM Reply With Quote

I really appreciate you replying on this.

What you are sayins is exactly what I am trying to achieve without getting a whole new image management script. My problem is that I cannot (because I don't know how to do it) create the variable ($pic1.$pic2 etc) out of the array that is being created by the script itself as per below. If I can find out exactly what picture names the array is finding I can then say that (in laymans terms anyway) 'the script is pulling each picture out of the 'venuepics' folder WHERE the image name (without the extension of .jpg) is equal to the id (related to' venueid') in the venuepics table (hope this make sense). Then I can assign whatever name/s the array extracts for that venue into variables called $pic1, $pic2 etc and put those variables into tigra_hints as you indicated.

This code below is located within my showvenue.php page but the actual location in the page where the pictures are visible contains only the line (which is a function) makegallery( $files, 5, 0, 80, 50); between php tags. The makegallery.php contains the following script
Code:

<?php
function makegallery($files, $cols, $mode, $w, $h)
{
echo "
<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\">";
$count = 0;

foreach( $files as $file ) {

if( $count % $cols == 0 ) echo "</tr>\n<tr>\n";
if( $mode == 0 ) {
if( substr($file,strlen($file)-3,3) == "gif" || substr($file,strlen($file)-3,3) == "jpg" || substr($file,strlen($file)-3,3) == "png" || substr($file,strlen($file)-4,4) == "jpeg") echo "<td align=\"center\" valign=\"middle\"><a href=\"/venuepics/".$file."\" target=\"_blank\"><img src=\"/makepicfit.php?file=".$file."&w=".$w."&h=".$h."\" style=\"border: 1px solid #BBBBBB\"></a></td>\n";
}
else {
if( substr($file,strlen($file)-3,3) == "gif" || substr($file,strlen($file)-3,3) == "jpg" || substr($file,strlen($file)-3,3) == "png" || substr($file,strlen($file)-4,4) == "jpeg") echo "<td align=\"center\" valign=\"middle\"><img src=\"/makepicfit.php?file=".$file."&w=".$w."&h=".$h."\" style=\"border: 1px solid #BBBBBB; cursor:pointer;\" onClick=\"if( this.style.border == '#bbbbbb 1px solid' ) {this.style.border = '2px solid #FF0000';} else {this.style.border = '#bbbbbb 1px solid';} \"></td>\n";
}

$count++;
}

echo "</table>";
}

?>


This is the code that is in the showvenue.php page..
Code:

$pics = dbGetRows("venuepics", "venueid='".$id."'");
$n = 0;
$files = array();
while($pic = mysql_fetch_array($pics, MYSQL_ASSOC))
array_push($files, $pic['id'].".jpg");


I am comptletely lost with this although I did attempt the solution in thread 4102 which seems to be what I am trying to achieve.

Best regards,

Garwil
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 6/28/2007 at 03:36 PM Reply With Quote

According to your code the name of the picture is temporarily stored in variable $file. The value is printed and the loop goes to the next picture. The code doesn't save the names in the array. Pictures directory is "/venuepics/"
View User's Profile View All Posts By User U2U Member
garwil
Junior Member

Posts: 4
Registered: 6/26/2007
Location: Durban
Member Is Offline
posted on 6/28/2007 at 03:41 PM Reply With Quote

/venupics/ is correct as the folder that the images are in.

That teh images is in a single file and looped....does this mean a problem to use with tigra? Or is there another way I can do it?
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
 Product Demonstrations Live Demo
Free Download Free Download
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004