Jump to content

mediasix

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mediasix's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. legend! thanks a lot, i knew it would have to be an array but again wasnt sure hwere. thank you so much. mediasix
  2. That is most excellent , Thank you! One question I have, what if there are multiple sets I want to exclude?? Thanks in advance, mediasix
  3. Hi, I have made a working gallery using the flickr api, it is all working great, but I want to put an exception in and cant figure out how to do it. Basically the code pulls all of my sets from flickr then displays all of the photos contained in those sets, but there is one set that I do not wish to be displayed. How can I put that in my code?? Here is the code: <?php require_once("./includes/phpflickr/phpFlickr.php"); $f = new phpFlickr("MY API KEY"); $photosets = $f->photosets_getList('MY FLICKR USER'); if(!empty($photosets)){ foreach ($photosets['photoset'] as $set) { $setid = $set[id]; $photosSetInfo = $f->photosets_getInfo($setid); $heading = $photosSetInfo['title']; $photos = $f->photosets_getPhotos($setid, NULL, 2); $html = "<li class='accordion_toggle_container'><a href='#' class='accordion_toggle'>".$heading."</a></li> \n <li class='accordion_content'> \n <ol class='photos'> \n"; // Get the friendly URL of the user's photos $person = $f->people_findByUsername($user_id); $photos_url = $f->urls_getUserPhotos($person['id']); foreach ($photos['photo'] as $photo) { $html .= "<li class='photo'>$photodate1<a href='".$f->buildPhotoURL($photo, "medium")."' class='lightview' rel='gallery[".$heading."]'><img alt='$photo[title]' src='".$f->buildPhotoURL($photo, "Square")."'/></a></li> \n"; } echo $html; echo "</ol>\n </li>\n"; } } ?> And this is what I want to do: <?php require_once("./includes/phpflickr/phpFlickr.php"); $f = new phpFlickr("MY API KEY"); $photosets = $f->photosets_getList('MY FLICKR USER'); if(!empty($photosets)){ foreach ($photosets['photoset'] as $set **EXCEPT PHOTOSET '72157605601956344'**) { $setid = $set[id]; $photosSetInfo = $f->photosets_getInfo($setid); $heading = $photosSetInfo['title']; $photos = $f->photosets_getPhotos($setid, NULL, 2); $html = "<li class='accordion_toggle_container'><a href='#' class='accordion_toggle'>".$heading."</a></li> \n <li class='accordion_content'> \n <ol class='photos'> \n"; // Get the friendly URL of the user's photos $person = $f->people_findByUsername($user_id); $photos_url = $f->urls_getUserPhotos($person['id']); foreach ($photos['photo'] as $photo) { $html .= "<li class='photo'>$photodate1<a href='".$f->buildPhotoURL($photo, "medium")."' class='lightview' rel='gallery[".$heading."]'><img alt='$photo[title]' src='".$f->buildPhotoURL($photo, "Square")."'/></a></li> \n"; } echo $html; echo "</ol>\n </li>\n"; } } ?> Any help would be apreciated Thanks, mediasix
  4. a lot of debugging later, i fixed it. just took out the elseif. code below. mediasix <?php include("includes/mysqlconnect.php") ?> <?php if($_REQUEST['submit']=='add_entry') { $title=$_REQUEST['title']; $content=$_REQUEST['content']; $query ="INSERT INTO test (title,content)"; $query.=" VALUES ('$title','$content')"; $result=mysql_query($query); } if($_REQUEST['submit']=='add_entry_two') { $title=$_REQUEST['title']; $content=$_REQUEST['content']; $query ="INSERT INTO test_two (title,content)"; $query.=" VALUES ('$title','$content')"; $result=mysql_query($query); } if($_REQUEST['action']="del_two") { mysql_query("DELETE FROM `test_two` WHERE `test_two`.`id`={$_REQUEST['id']};"); } if($_REQUEST['action']="del") { mysql_query("DELETE FROM test WHERE id={$_REQUEST['id']};"); } else { echo "NOT WORKING BUD"; } ?> <html> <head> <title>database test</title> </head> <body> <div id="wrapper"> <!--ADD ENTRY FORMS--> <h2>ADD TEST ENTRY</h2> <form id="add_entry" action="index.php" method="get"> Title: <input type="text" name="title"> Content: <input type="text" name="content"> <input type="submit" name="submit" value="add_entry"> </form> <form id="add_entry_two" action="index.php" method="get"> Title: <input type="text" name="title"> Content: <input type="text" name="content"> <input type="submit" name="submit" value="add_entry_two"> </form> <!-- END OF ADD ENTRY FORMS--> <!--CURRNET ENTRIES--> <h2>TABLE test</h2> <table border="0" cellpadding="0" cellspacing="0"> <?php $result=mysql_query("SELECT id,title,content FROM test ORDER BY id;"); $i=0; while( $row=mysql_fetch_array($result) ) { echo "<tr valign=center>"; echo "<td><b>".$row['id']."</b></td>"; echo "<td>".$row['title']." </td>"; echo "<td>".$row['content']." </td>"; echo "<td><a style=\"color:red;\" href=index.php?action=del&id=".$row['id'].">[Delete?]</a></td>"; echo "<td></td>"; echo "</tr>"; $i++; } ?> </table> <!--END OFCURRNET ENTRIES--> <!--CURRNET ENTRIES TWO--> <h2>TABLE test_two</h2> <table border="0" cellpadding="0" cellspacing="0"> <?php $result=mysql_query("SELECT id,title,content FROM test_two ORDER BY id;"); $i=0; while( $row=mysql_fetch_array($result) ) { echo "<tr valign=center>"; echo "<td><b>".$row['id']."</b></td>"; echo "<td>".$row['title']." </td>"; echo "<td>".$row['content']." </td>"; echo "<td><a style=\"color:red;\" href=index.php?action=del_two&id=".$row['id'].">[Delete?]</a></td>"; echo "<td></td>"; echo "</tr>"; $i++; } ?> </table> <!--END OFCURRNET ENTRIES TWO--> </div><!--END OF WRAPPER--> </body> </html>
  5. OK so i've got the submission sorted, but i am faced with a new problem. i also have 2 acctions, and the first one works but the second one does nothing. code below thanks mediasix <?php include("includes/mysqlconnect.php") ?> <?php if($_REQUEST['submit']=='add_entry') { $title=$_REQUEST['title']; $content=$_REQUEST['content']; $query ="INSERT INTO test (title,content)"; $query.=" VALUES ('$title','$content')"; $result=mysql_query($query); } elseif($_REQUEST['submit']=='add_entry_two') { $title=$_REQUEST['title']; $content=$_REQUEST['content']; $query ="INSERT INTO test_two (title,content)"; $query.=" VALUES ('$title','$content')"; $result=mysql_query($query); } elseif($_REQUEST['action']="del") { mysql_query("DELETE FROM test WHERE id={$_REQUEST['id']};"); } elseif($_REQUEST['action']="del_two") { mysql_query("DELETE FROM test_two WHERE id={$_REQUEST['id']};"); } else { echo "NOT WORKING BUD"; } ?> <html> <head> <title>database test</title> <script type="text/javascript" src="scripts/prototype-1.6.0.2.js"></script> </head> <body> <div id="wrapper"> <!--ADD ENTRY FORMS--> <h2>ADD TEST ENTRY</h2> <form id="add_entry" action="index.php" method="get"> Title: <input type="text" name="title"> Content: <input type="text" name="content"> <input type="submit" name="submit" value="add_entry"> </form> <form id="add_entry_two" action="index.php" method="get"> Title: <input type="text" name="title"> Content: <input type="text" name="content"> <input type="submit" name="submit" value="add_entry_two"> </form> <!-- END OF ADD ENTRY FORMS--> <!--CURRNET ENTRIES--> <table border="0" cellpadding="0" cellspacing="0"> <?php $result=mysql_query("SELECT id,title,content FROM test ORDER BY id;"); $i=0; while( $row=mysql_fetch_array($result) ) { echo "<tr valign=center>"; echo "<td class=tabval><b>".$row['id']."</b></td>"; echo "<td class=tabval>".$row['title']." </td>"; echo "<td class=tabval>".$row['content']." </td>"; echo "<td class=tabval><a style=\"color:red;\" href=index.php?action=del&id=".$row['id'].">[Delete?]</a></td>"; echo "<td class=tabval></td>"; echo "</tr>"; $i++; } ?> </table> <!--END OFCURRNET ENTRIES--> <!--CURRNET ENTRIES TWO--> <table border="0" cellpadding="0" cellspacing="0"> <?php $result=mysql_query("SELECT id,title,content FROM test_two ORDER BY id;"); $i=0; while( $row=mysql_fetch_array($result) ) { echo "<tr valign=center>"; echo "<td class=tabval><b>".$row['id']."</b></td>"; echo "<td class=tabval>".$row['title']." </td>"; echo "<td class=tabval>".$row['content']." </td>"; echo "<td class=tabval><a style=\"color:red;\" href=index.php?action=del_two&id=".$row['id'].">[Delete?]</a></td>"; echo "<td class=tabval></td>"; echo "</tr>"; $i++; } ?> </table> <!--END OFCURRNET ENTRIES TWO--> </div><!--END OF WRAPPER--> </body> </html>
  6. Hi, when processing my form i am getting the following error: Parse error: syntax error, unexpected T_IS_NOT_IDENTICAL, expecting ',' or ')' (code below) Please help, thanks mediasix <?php include("includes/mysqlconnect.php") ?> <?php if(isset($_REQUEST['submit']!=='add_entry',)) { $title=$_REQUEST['title']; $content=$_REQUEST['content']; $query ="INSERT INTO test (title,content)"; $query.=" VALUES ('$title','$content')"; $result=mysql_query($query); if ($result) echo "<b>Successfully Posted!</b>"; else echo "<b>ERROR: unable to post.</b>"; } elseif(isset($_REQUEST['submit']!=='add_entry_two')) { $title=$_REQUEST['title']; $content=$_REQUEST['content']; $query ="INSERT INTO test_two (title,content)"; $query.=" VALUES ('$title','$content')"; $result=mysql_query($query); if ($result) echo "<b>Successfully Posted! TWO</b>"; else echo "<b>ERROR: unable to post.</b>"; } elseif(isset($_REQUEST['action']!=="del")) { mysql_query("DELETE FROM test WHERE id={$_REQUEST['id']};"); } else { echo "NOT WORKING BUD"; } ?>
  7. hi guys, i have a page that i am developing which has a few forms on it (or plans to) i am at the stage of adding the second form, i have a conditional 'submit' on the processing page. but when i submit, both of the conditionals process the form attributes. i may not be explaining very well so here is the code: <html> <head> <title>database test</title> </head> <body> <h2>currnt entries</h2> <form action="addentry.php" method="get"> Title: <input type="text" name="title"> Content: <input type="text" name="content"> <input type="submit" name="add_entry" value="DO IT!"> </form> <form action="addentry.php" method="get"> Title: <input type="text" name="title"> Content: <input type="text" name="content"> <input type="submit" name="add_entry_two" value="DO IT! 2"> </form> </body> </html> <?php include("includes/mysqlconnect.php") ?> <?php if($_REQUEST['submit']!='add_entry') { $title=$_REQUEST['title']; $content=$_REQUEST['content']; $query ="INSERT INTO test (title,content)"; $query.=" VALUES ('$title','$content')"; $result=mysql_query($query); if ($result) echo "<b>Successfully Posted!</b>"; else echo "<b>ERROR: unable to post.</b>"; } if($_REQUEST['submit']!='add_entry_two') { $title=$_REQUEST['title']; $content=$_REQUEST['content']; $query ="INSERT INTO test_two (title,content)"; $query.=" VALUES ('$title','$content')"; $result=mysql_query($query); if ($result) echo "<b>Successfully Posted! TWO</b>"; else echo "<b>ERROR: unable to post.</b>"; } else { echo "NOT WORKING BUD"; } ?> thanks in anticipation mediasix
  8. take a close look at the list, there are closing tags for elements that dont exist. ( i hav made them bold) maybe restructure and try again. mediasix <ul > <li>Alumni</li> <li>Committee</li> <li>Teams <ul > <li>94/95</li> </ul> </li> </ul> </li> </ul>
  9. not to worry i answered my own question, here is the code below. my only question is, how could i make it work with the alt attribute?? cheers mediasix <html> <head> <script type="text/javascript"> if (document.images) { image01 = new Image; image02 = new Image; image01.src = 'images/01.jpg'; image02.src = 'images/02.jpg'; } else { image01 = ''; image02 = ''; document.rollimg = ''; } </script> </head> <body> <p align="center"><img src="images/01.jpg" border="0" alt="Larger version of one of the smaller images below" name="rollimg" /></p> <p align="center"> <img src="images/01small.jpg" onclick="document.rollimg.src=image01.src;" /> <img src="images/02small.jpg" onclick="document.rollimg.src=image02.src;" /> </p> </body>
  10. Hi, I want to acheive something that i am unsure how to do. i want to have a picture of say 400px by 400px with several thumbnails of 50px by 50px underneath. when you click on each one, it will change the 400px by 400px image, no matter which one you click on. i have some code but dont think that it is sufficient. (the code is for onmouseover but i want it for onclick <img src="images/01.jpg" alt="image01" name="image01" id="image01"> <img src="images/02.jpg" alt="image02" name="image02" id="image02" onclick="image01.src='images/image02.jpg'> please help thanks in advance mediasix
  11. yeah its on, i have tried on my host 'dreamhost' and on my local install, both times nothing! i'm really stuck, any more advise welcomed with open arms thanks mediasix
  12. ??? I have WAMP installed on my XP x64 with PHP and that works just fine......
  13. if anyone could tell me why error_reporting(E_ALL); isnt working then i will try and debug myself, but even that wont work! please help ???
  14. OK , ive added: error_reporting(E_ALL); to the top of my code and also i changed '$id' to '$1' - same as before, nothing! the code and link is below - thanks people http://mediasix.co.uk/weblog/weblogentry.php?1=this%20is%20a%20test%20entry <?php error_reporting(E_ALL); mysql_connect("xxxxxx","xxxxxx","xxxxxx"); mysql_select_db("xxxxxx"); $query="SELECT * FROM weblog WHERE title='$1'"; $result=mysql_query($query); $row = mysql_fetch_array($result); $date=$row['date']; $title=$row['title']; $content=$row['content']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>mediasix blog - <?php echo "$title"?></title> <link href="../css/mediasix.css" rel="stylesheet" type="text/css" /> <link href="../css/mediasix-print.css" rel="stylesheet" type="text/css" media="print" /> <script type="text/javascript" src="../scripts/equalcolumns.js"></script> </head> <body> <div id="header"><img src="../images/mediasix-web-logo.gif" alt="logo" width="600" height="100" /></div> <div id="holder"> <div id="contentholder"> <div class="nav" align="center" id="nav"><?php include("../includes/menu.php");?></div> <div id="content"> <h1><?php echo "$title"?></h1><h2><?php echo "$date"?></h2> <p><?php echo "$content"?></P></div> <div id="othercontent"><?php include ("../includes/othercontent.php");?></div> <div id="footer"><?php include("../includes/footer.php");?></div> </div>
×
×
  • 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.