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.
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.
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.
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()" />
<img src="$pic2/>" width="100" onMouseOver="myHint2.show('tt1', this)" onMouseOut="myHint2.hide()" />
If this is not ppossible then I will certainly post a support script if all else fails
if you want to print the value of PHP variable into the HTML stream you can do:
<img src="<? echo $pic1 ?>/>" width="100" ...
<img src="<?= $pic1 ?>/>" width="100" ...
if this is what you're trying to do
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
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/"
/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?