50Megs Tech Logo


We have moved to TechnoFyed Support Forum, but this forum will remain open.



Pages: (2) [1] 2   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

Organizing website images?

Posted: November 26, 2008 05:05 am  
Quote Post



Staff Manager / Admin Asst.
*********
Member No.: 6
Joined: September 17, 2006
Group: Staffing Manager
Posts: 1,275




AOLMSN
One of the updates that I would really like to get done on my website is to make some type of order for all the photographs on the "Art & Pictures" page. Simple problem you run into with too many images on one page is the slow loading. Especially for slower connections. Wondering if there is a way to avoid making a separate file for each section of photographs? The PHP include helps some, but obviously you still need a separate file for each page. Any ideas everyone? I would like to avoid using javascript if possible... smile.gif


--------------------
user posted imageGT4AWDuser posted image
user posted image
Google Talk ID: gt4awd@gmail.com
My Website - I.D.W. *NEW HOST*
My Forum - I.D.W. *NEW HOST*
Email: gt4awd [at] lycos [dot] com
AutoHotKey User Name: .AHK
My YouTube Videos
 
PMEmail PosterUsers Website
Top

Posted: November 26, 2008 11:13 pm  
Quote Post



Administrator
*********
Member No.: 1
Joined: September 04, 2006
Group: Admin
Posts: 1,663




AOL
You could use innerhtml, which is javascript. That would be really awesome as you could load the other pics without loading another page. However that's using Javascript.

Try making a page with PHP. Say that your picture page is pictures.php. I think this would work. You might have to make adjustments to it though.
CODE

<? require(your top file);
?>
<a href="http://internetdatabasewebsite.110mb.com/pictures.php?page=1">Page 1</a>
<a href="http://internetdatabasewebsite.110mb.com/pictures.php?page=2">Page 2</a>

<?
$page = $_GET['page']
if($page == 1){
$start = 1;
}
elseif($page == 2){
$start = 11;
}

$stop = $start + 9;
?>
<table width="70%">.
<?
for ( $counter = $start; $counter <= stop; $counter += 1) {
echo '<tr><td><img src="image . $counter . ".jpg"</td></tr>';
}
?>
</table>
<br>
<center>
<a href="#top">Go to Top</a>
</center>
<? require(your bottom page here); ?>


That probably has tons of syntax mistakes. Anyways, you know you could just add more links and elseifs if needed.

By the way, the require function makes the page not load if it is unable to include the file, whereas the include function makes for a pretty ugly looking page if the file is missing.


--------------------
 
PMEmail PosterUsers Website
Top

Posted: November 26, 2008 11:54 pm  
Quote Post



Senior Moderator
*********
Member No.: 4
Joined: September 04, 2006
Group: Super Moderators
Posts: 562




YahooMSN
QUOTE (gt4awd @ November 26, 2008 05:05 am)
One of the updates that I would really like to get done on my website is to make some type of order for all the photographs on the "Art & Pictures" page. Simple problem you run into with too many images on one page is the slow loading. Especially for slower connections. Wondering if there is a way to avoid making a separate file for each section of photographs? The PHP include helps some, but obviously you still need a separate file for each page. Any ideas everyone? I would like to avoid using java script if possible... smile.gif

Why don't you just use an on-line photo album like google or webshots?. Webshots is clean and not quite as flashy as google witch I really like. I use them both plus a java script photo album that I made my self. Oh and by the way see if you can fix the password retrieval tool, I tried to log in a while back but had forgot my password and tried to retrieve my password several times but it never sent it to me.


--------------------
. . . . . .Zombie. . . . . .
user posted image
. . . . . . . . . . . .user posted image. . . . . . . . . . . .
user posted image
 
PMEmail PosterUsers Website
Top

Posted: December 02, 2008 03:50 am  
Quote Post



Staff Manager / Admin Asst.
*********
Member No.: 6
Joined: September 17, 2006
Group: Staffing Manager
Posts: 1,275




AOLMSN
I actually can't follow that script at all Wierdo. If you were to produce a working example it would help a lot more. Also, add comments to explain what everything does... I would appreciate it as what you have shown seems promising. Still have no decided exactly how I'm going to do this. I have a feeling it's going to turn into a lot of work... Just to organize some images, but that's what happens when you make your website in Notepad only. Fun stuff! smile.gif

Zombie, I have not really checked out any of the online photo albums, but I doubt one of them will have an interface I can integrate with my website. Doing this in a way that would allow me to completely customize anything. Also, as I said, I would like to avoid javascript which I'm sure would be needed to integrate the photograph album. smile.gif


--------------------
user posted imageGT4AWDuser posted image
user posted image
Google Talk ID: gt4awd@gmail.com
My Website - I.D.W. *NEW HOST*
My Forum - I.D.W. *NEW HOST*
Email: gt4awd [at] lycos [dot] com
AutoHotKey User Name: .AHK
My YouTube Videos
 
PMEmail PosterUsers Website
Top

Posted: December 02, 2008 05:44 pm  
Quote Post



Administrator
*********
Member No.: 1
Joined: September 04, 2006
Group: Admin
Posts: 1,663




AOL
Actually I doubt 110mb would allow that PHP. All the free hosts we tried together don't allow more advanced PHP than the include function if you remember.

I got the script working well on my site.

CODE
<a href="imageorganization.php?page=1">Page 1</a>
<a href="imageorganization.php?page=2">Page 2</a>

<?
$page = $_GET['page'];
if(!$page > "0"){
$page = "1";
}
if($page == "1"){
$start = "1";
}
elseif($page == "2"){
$start = "11";
}

$stop = $start + 9;
?>
<table width="70%">
<?
for ($counter = $start; $counter <= $stop; $counter += 1) {
echo '<tr><td><img src="imageorganization/image' . $counter . '.bmp"></td></tr>';
}
?>
</table>
<br>
<center>
<a href="#top">Go to Top</a>
</center>


And here it is with comments in it:

CODE

<a href="imageorganization.php?page=1">Page 1</a>
<a href="imageorganization.php?page=2">Page 2</a>

Just two links linking to the different pages.  The "?page=1" is just a variable added at the end of the link that PHP can use.

<?

Start the PHP.

$page = $_GET['page'];

GET "gets" the variable from the address.  So what's happening here is we get the variable from the address and store it in the page variable.  We could use the $_GET['page'] variable for all the following operations, but it would just be more typing to do.

if(!$page > "0"){

If the variable "page" is NOT (see the exclamation point before the page variable?) greater than zero

$page = "1";
}

Then set the variable "page" equal to 1.  This makes sure that something displays if the page variable isn't at the end of the address.


if($page == "1"){

If the variable "page" is equal to 1

$start = "1";
}

Set the variable "start" equal to one.  This is the number of the first image that will be displayed.

elseif($page == "2"){

Otherwise, if the variable "page" is equal to 2

$start = "11";
}

Set the variable "start" to 11.  

$stop = $start + 9;

Define the number of the last picture to be displayed.  So if the page is 1, then the last picture shown would be 10, thus 1 + 9.  Same thing for page 2, the start variable is 11, so the stop variable would be 20.

?>

End the PHP.

<table width="70%">

You know about tables.

<?

Start PHP.

for ($counter = $start; $counter <= $stop; $counter += 1) {

Probably the most confusing thing in this script.  The first part, $counter = $start; sets the counter variable to equal the start variable, which in this script is either 1 or 11.  The $counter <= $stop; means perform the operations within the curly brackets ( { and } ) while the counter variable is less than the stop variable.  The $counter += 1 part adds 1 every time the loop is run.

echo '<tr><td><img src="imageorganization/image' . $counter . '.bmp"></td></tr>';
}

This sends the opening table row and table data information to the browser.  Then it sends the image data and the folder (you can change the folder).  Then it sends the number of the counter variable.  If the counter variable is 5, then it basically sends <img src="imageorganization/image5.bmp">  Last, it sends the closing table row and table data information.

?>

Ends the PHP.

</table>
<br>
<center>
<a href="#top">Go to Top</a>
</center>

Ends the table, adds a space to the bottom, and gives you a centered link to take the viewer to the top of the page.


I really hope those comments help because it took me a long time to type them! Note that you would have to rename all of your pictures to image1.jpg, image2,jpg, image3.jpg, etc, or just 1.jpg, 2.jpg, 3.jpg, etc.

Working Example: http://wengerenterprises.com/imageorganization.php


--------------------
 
PMEmail PosterUsers Website
Top

Posted: January 25, 2009 03:39 pm  
Quote Post



Administrator
*********
Member No.: 1
Joined: September 04, 2006
Group: Admin
Posts: 1,663




AOL
So have you done any kind of organization?


--------------------
 
PMEmail PosterUsers Website
Top

Posted: January 26, 2009 10:42 am  
Quote Post



Elite Tech Member
******
Member No.: 58
Joined: June 13, 2007
Group: Members
Posts: 78




All of this programming language wacko.gif

I'm glad I link my website pictures to google/picasa ...

It keeps all of them in a nice order for me


http://picasaweb.google.com/stevepelonero
I still have lots to add to this site

http://picasaweb.google.com/PassaicValleyUNICO2008

 
PMEmail PosterUsers Website
Top

Posted: February 05, 2009 09:47 am  
Quote Post



Staff Manager / Admin Asst.
*********
Member No.: 6
Joined: September 17, 2006
Group: Staffing Manager
Posts: 1,275




AOLMSN
I checked out Picasa, and really liked it man. Thanks for the link! Now I just have to figure out if there is a way to fully implement my online photograph album to my website...


--------------------
user posted imageGT4AWDuser posted image
user posted image
Google Talk ID: gt4awd@gmail.com
My Website - I.D.W. *NEW HOST*
My Forum - I.D.W. *NEW HOST*
Email: gt4awd [at] lycos [dot] com
AutoHotKey User Name: .AHK
My YouTube Videos
 
PMEmail PosterUsers Website
Top

Posted: February 16, 2009 12:05 am  
Quote Post



Staff Manager / Admin Asst.
*********
Member No.: 6
Joined: September 17, 2006
Group: Staffing Manager
Posts: 1,275




AOLMSN
From what I can tell the only way to implement this album onto my website is by linking each separate image folder on the album to my website. That would of course be very easy, but upon clicking the link it would open a new page to the picasa online album. What do you guys think?


--------------------
user posted imageGT4AWDuser posted image
user posted image
Google Talk ID: gt4awd@gmail.com
My Website - I.D.W. *NEW HOST*
My Forum - I.D.W. *NEW HOST*
Email: gt4awd [at] lycos [dot] com
AutoHotKey User Name: .AHK
My YouTube Videos
 
PMEmail PosterUsers Website
Top

Posted: February 16, 2009 12:07 am  
Quote Post



Administrator
*********
Member No.: 1
Joined: September 04, 2006
Group: Admin
Posts: 1,663




AOL
Can you embed the albums in seperate pages? I know that would require JavaScript, but most people have it turned on.


--------------------
 
PMEmail PosterUsers Website
Top

Posted: March 03, 2009 07:46 pm  
Quote Post



Staff Manager / Admin Asst.
*********
Member No.: 6
Joined: September 17, 2006
Group: Staffing Manager
Posts: 1,275




AOLMSN
Last night I worked on updating the websites Artwork & Photograph section to implement the Picasa Google photograph album. Let me know what you guys think! By the way, what do you think would be the best way to add the title of each separate album on the image links? I was thinking a floating div box, but can't remember exactly how to float the div box where I want it. Haven't really looked into it much yet though.


--------------------
user posted imageGT4AWDuser posted image
user posted image
Google Talk ID: gt4awd@gmail.com
My Website - I.D.W. *NEW HOST*
My Forum - I.D.W. *NEW HOST*
Email: gt4awd [at] lycos [dot] com
AutoHotKey User Name: .AHK
My YouTube Videos
 
PMEmail PosterUsers Website
Top

Posted: March 03, 2009 07:53 pm  
Quote Post



Administrator
*********
Member No.: 1
Joined: September 04, 2006
Group: Admin
Posts: 1,663




AOL
Pretty good. It would be cool if you could get them on your site, but that would require JS I'm sure.


--------------------
 
PMEmail PosterUsers Website
Top

Posted: March 03, 2009 08:02 pm  
Quote Post



Staff Manager / Admin Asst.
*********
Member No.: 6
Joined: September 17, 2006
Group: Staffing Manager
Posts: 1,275




AOLMSN
Or even worse... Frames! sad.gif Probably both. Javascript wouldn't bug me too much, but I'll never use frames on any website again... smile.gif


--------------------
user posted imageGT4AWDuser posted image
user posted image
Google Talk ID: gt4awd@gmail.com
My Website - I.D.W. *NEW HOST*
My Forum - I.D.W. *NEW HOST*
Email: gt4awd [at] lycos [dot] com
AutoHotKey User Name: .AHK
My YouTube Videos
 
PMEmail PosterUsers Website
Top

Posted: March 03, 2009 08:07 pm  
Quote Post



Administrator
*********
Member No.: 1
Joined: September 04, 2006
Group: Admin
Posts: 1,663




AOL
Yeah I remember when you were first using them... I couldn't even see your navigation! Remember those days?


--------------------
 
PMEmail PosterUsers Website
Top

Posted: March 05, 2009 08:01 pm  
Quote Post



Staff Manager / Admin Asst.
*********
Member No.: 6
Joined: September 17, 2006
Group: Staffing Manager
Posts: 1,275




AOLMSN
The good old days when we only knew HTML? Yeah, those were good times man! ohmy.gif Wierdo, what do you think would be the best way to add titles to those image links? I'm still thinking a floating div box, but if you have any other ideas, or anyone else does, please let me know. smile.gif


--------------------
user posted imageGT4AWDuser posted image
user posted image
Google Talk ID: gt4awd@gmail.com
My Website - I.D.W. *NEW HOST*
My Forum - I.D.W. *NEW HOST*
Email: gt4awd [at] lycos [dot] com
AutoHotKey User Name: .AHK
My YouTube Videos
 
PMEmail PosterUsers Website
Top

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages: (2) [1] 2  Reply to this topicStart new topicStart Poll