If the problem persists e-mail webmaster@theglasgowstory.com quoting error code TGSEU011.
"; error($head, $message, $backlink, $backtext); } //add htmlspecialchars $savename = htmlspecialchars($savename); //first check to see whether savename already in use (unless already asked the question) if ($okay != 99) { $check = mysql_query("select count(*) from save where user = '$user' and savename = '$savename'"); if (!$check) { dohead("TheGlasgowStory - ".$head); $message = "Unable to save album at the moment.
If the problem persists e-mail webmaster@theglasgowstory.com quoting error code TGSEU012.
"; error($head, $message, $backlink, $backtext); } $check = mysql_result($check,0,0); } /**************************************************** * Need to delete existing save file if user says so * ****************************************************/ if ($okay ==99) { $remove = mysql_query("delete from save where user = '$user' and savename = '$savename'"); if (!$remove) { dohead("TheGlasgowStory - ".$head); $message = "Unable to remove your previously saved album at the moment.
If the problem persists e-mail webmaster@theglasgowstory.com quoting error code TGSEU013.
"; error($head, $message, $backlink, $backtext); } } /********************************************************* * Check to make sure user doesn't have more than 5 saves * *********************************************************/ if ($check <1) { $numsaves = mysql_query("select distinct savename from save where user = '$user'"); if (!$numsaves) { dohead("TheGlasgowStory - ".$head); $message = "Unable save album at the moment.
If the problem persists e-mail webmaster@theglasgowstory.com quoting error code TGSEU014.
"; error($head, $message, $backlink, $backtext); } $numsaves = mysql_num_rows($numsaves); if ($numsaves >=5) { dohead("TheGlasgowStory - ".$head); $message = "You already have 5 albums saved."; error($head, $message, "saves.php", "To delete a saved album go to this page"); } /********************** * Insert save into db * **********************/ while ($element = each($select_ids)) { $saveinsert = mysql_query("insert into save set user = '$user', savename = '$savename', inum = '$element[key]'"); if (!$saveinsert) { dohead("TheGlasgowStory - ".$head); $message = "A problem has arisen whilst saving you album.
If the problem persists e-mail webmaster@theglasgowstory.com quoting error code TGSEU015.
"; error($head, $message, $backlink, $backtext); } } reset($select_ids); $saved = 99; $link = urldecode($link); /**************** * Log user save * ****************/ $date = date(U); $log = mysql_query("insert into accesslog set ip = '$userip', uname = '$user', logdate = '$date', actiontype = 'Album save', details = 'albumname = $savename'"); } } /**************************************** * Loads saved images if variable passed * ****************************************/ if ($load) { $load = htmlspecialchars($load); /*********************************************************** * Check to make sure selected album is 'owned' by the user * ***********************************************************/ $owns = mysql_query("select count(savename) from save where savename = '$load' and user = '$user'"); if (!$owns) { dohead("TheGlasgowStory: Error"); $message = "Unable to load saved album.
If the problem persists e-mail webmaster@theglasgowstory.com quoting error code TGSEU016."; error($head, $message, $back, $backtext); } $owns = mysql_result($owns,0,0); if ($owns <1) { dohead("TheGlasgowStory: Error"); $message = "Unable to load saved album.
If the problem persists e-mail webmaster@theglasgowstory.com quoting error code TGSEU017."; error($head, $message, $back, $backtext); } /*************************** * Retrieve saved image IDs * ***************************/ $getsave = mysql_query("select inum from save where savename = '$load' and user = '$user'"); if (!$getsave) { dohead("TheGlasgowStory: Error"); $message = "Unable to load saved album.
If the problem persists e-mail webmaster@theglasgowstory.com quoting error code TGSEU018."; error($head, $message, $back, $backtext); } session_unregister("select_num"); session_unregister("select_ids"); session_register("select_num"); session_register("select_ids"); /********************************************* * NOTE: Also replacing save_auto with images * *********************************************/ $del = mysql_query("delete from save_auto where user = '$user'"); $select_num = 0; $select_ids = array(); $number = mysql_num_rows($getsave); $select_num = $number; for ($i=0;$i<$number;$i++) { $row = mysql_fetch_array($getsave); $select_ids[$row[inum]] = 1; $saveinsert = mysql_query("insert into save_auto set user = '$user', inum = '$row[inum]'"); } /**************** * Log user load * ****************/ $date = date(U); $log = mysql_query("insert into accesslog set ip = '$userip', uname = '$user', logdate = '$date', actiontype = 'Album load', details = 'albumname = $load'"); } $period = "N"; if ($save == 99 && $check >0) $title = "Savename '".$savename."' already in use"; else if ($load) $title = "Photo Album '".$load."' loaded"; else if ($saved == 99 && !$check) $title = "Photo Album '".$savename."' saved"; else $title = "Your Photo Album"; format_pre($period, stripslashes($title), $feature, $_COOKIE); ?>

0) { ?>

You already have a saved album named ''

Do you want to replace it?

"); if (substr($link,0,6) == "search") echo("

Back to search results

"); //$isillreg = session_is_registered("illreg"); if($illreg) echo("

Return to 'Illustrate Story' page of OurGlasgowStory

"); //if no images in album: if ($select_num == 0) echo("

You do not have any images in your album.
 
Your photo album is the place to store images that are of particular interest to you. When you open an image in TheGlasgowStory click on the 'Add Image to Photo Album' link and the image will be added to this page.
Every page in TheGlasgowStory has a link to return to this page so no matter where you are you can always return to view the images you have selected.

"); else { /*********************************************************** * If there are images selected they will be displayed here * ***********************************************************/ while ($element = each($select_ids)) { $getname = mysql_query("select webtitle from image where inum = '$element[key]'"); $getname = mysql_fetch_array($getname); $file = $imgdir.$element[key]."_s.jpg"; ?> "); } echo("
"); ?>

You can remove an image from your album by opening it and clicking on the 'Remove image from Photo Album' link.

"); /************************************ * If album has been saved show user * ************************************/ if ($saved == 99) { echo("

 
Your album has been saved with the album name '".stripslashes($savename)."'.

You can reload or delete your saved albums by clicking on the 'View your saved Photo Albums' link on the right hand side of every page.

"); } else { /********************************************************* * If user is logged on then has the option to save album * *********************************************************/ if ($user) { ?>

 
Save your album

Once you save your album you can reload it each time you log on to TheGlasgowStory. All you need to do is enter an album name in the box below and press the 'save' button. You can save up to 5 different albums and these can be loaded or deleted by clicking on the 'View your saved Photo Albums' link located on the right hand side of every page.

 
Register with TheGlasgowStory and you can save your album! Registered users can save up to five different photo albums. Once you've saved a photo album you can reload it whenever you use TheGlasgowStory. Registration is free of charge and allows you to save your favourite images for as long as you want! To register simply click on the 'Register with TheGlasgowStory' button on the right hand side of every page in TheGlasgowStory and follow the instructions.