Jump to content

andrew_biggart

Members
  • Posts

    363
  • Joined

  • Last visited

  • Days Won

    1

andrew_biggart last won the day on November 4 2013

andrew_biggart had the most liked content!

About andrew_biggart

  • Birthday 10/27/1985

Contact Methods

  • Website URL
    http://www.andrewbiggart.co.uk

Profile Information

  • Gender
    Male
  • Location
    Manchester

andrew_biggart's Achievements

Regular Member

Regular Member (3/5)

1

Reputation

  1. Surely it's as simple as including your header and footer files? Look at single.php and use it as a template. Just replace the Wordpress loop, with what ever content you want to appear on that page.
  2. Why are you even allowing exe files to be uploaded? This can be avoiding easily...
  3. I've re-typed it, and it's working now. I think it might have been a caching issue. Dam Google chrome! <?php $today = date("Y-m-d"); $week = date("Y-m-d",strtotime("+1 week")); $sql1 = "SELECT * FROM jobsT WHERE job_status = 'Accepted' AND job_deadline BETWEEN '$today' AND '$week'"; $result1 = mysql_query($sql1); ?>
  4. Sorry, that's a typo. It's actually job_status. But thats's still not pulling any records through...
  5. I'm trying to add an additional parameter to the WHERE statement, which will only select jobs with a status of 'Accepted' and are within the next week. However when I add this parameter, it returns no results. i have checked, and there is definitely jobs which should be show. What am I doing wrong? <?php $today = date("Y-m-d"); $week = date("Y-m-d",strtotime("+1 week")); $sql1 = " SELECT * FROM jobsT WHERE job status = 'Accepted' AND job_deadline BETWEEN '$today' AND '$week'"; $result1 = mysql_query($sql1); ?>
  6. School boy syntax error. It's working now. <?php $today = date("Y-m-d"); $week = date("Y-m-d",strtotime("+1 week")); $sql = " SELECT * FROM jobsT WHERE job_deadline BETWEEN '$today' AND '$week'"; $result = mysql_query($sql); ?>
  7. I thought this would do it, but it isn't pulling out any records. <?php $today = date("Y-m-d"); $week = date("Y-m-d",strtotime("+1 week")); $sql = " SELECT * FROM jobsT WHERE job_deadline BETWEEN $today AND $week"; $result = mysql_query($sql); ?>
  8. I'm struggling to get my head around the logic of this, and wondering if someone can point me in the right direction. Overview What I'm trying to do is query the database and get all records which have a date which falls within the next week. Can anyone point me in the right direction?
  9. Hello, I created a simple login script with password hashing a while back here : https://github.com/andrewbiggart/phppass. It's slightly outdated, but might be useful, and fit your requirements. A
  10. I've made a few teaks and added this to Github incase anyone wants it. https://github.com/andrewbiggart/instafeed
  11. I've modified the code so that it only displays 20 images. It will create four different unordered lists which you can style however you want. <?php function getFollowgram() { $url = "http://instagram.com/tags/nfl/feed/recent.rss"; $s = file_get_contents($url); $ar = array(); $count = 0; $stop = 0; $limit = 20; // Limit the results $open = "<ul class=\"instagram\">"; // Set html wrapper class preg_match_all('#<item>(.*)</item>#Us', $s, $items); echo $open; // Open html wrapper for($i=0;$i<count($items[1]);$i++) { if($stop != $limit){ $item = $items[1][$i]; preg_match_all('#<link>(.*)</link>#Us', $item, $temp); $link = $temp[1][0]; preg_match_all('#<pubDate>(.*)</pubDate>#Us', $item, $temp); $date = date("d-m-Y H:i:s",strtotime($temp[1][0])); preg_match_all('#<title>(.*)</title>#Us', $item, $temp); $title = $temp[1][0]; preg_match_all('#<img src="([^>]*)">#Us', $item, $temp); $thumb = $temp[1][0]; $ar['date'][$i] = $date; $ar['image'][$i] = str_replace("_5.jpg","_6.jpg",$thumb); $ar['bigimage'][$i] = str_replace("_5.jpg","_7.jpg",$thumb); $ar['link'][$i] = $link; $ar['title'][$i] = $title; if($count != 5){ echo '<li><a href="' . $ar['link'][$i] . '" title="' . $ar['title'][$i] .'" target="_blank"><img src="' . $ar['link'][$i] .'" alt="' . $ar['title'][$i] .'"/></a></li>'; $count ++; } else { echo '</ul>' . $open .'<li><a href="' . $ar['link'][$i] . '" title="' . $ar['title'][$i] .'" target="_blank"><img src="' . $ar['link'][$i] .'" alt="' . $ar['title'][$i] .'"/></a></li>'; $count = 0; } $stop ++; } } echo "</ul>"; // Close html wrapper } getFollowgram(); ?> I've started some basic styling for you as well to resize the images. <style> .instagram { width:550px; margin:0; padding:0; list-style:none; } .instagram li { float:left; margin:0 10px 10px 0; } .instagram li a img { width:100px; } </style>
  12. So I clearly didn't read what you wrote. However I've modified the script to pull most recent instagram shots from public users. <?php function getFollowgram() { $url = "http://instagram.com/tags/nhl/feed/recent.rss"; $s = file_get_contents($url); preg_match_all('#<item>(.*)</item>#Us', $s, $items); $ar = array(); for($i=0;$i<count($items[1]);$i++) { $item = $items[1][$i]; preg_match_all('#<link>(.*)</link>#Us', $item, $temp); $link = $temp[1][0]; preg_match_all('#<pubDate>(.*)</pubDate>#Us', $item, $temp); $date = date("d-m-Y H:i:s",strtotime($temp[1][0])); preg_match_all('#<title>(.*)</title>#Us', $item, $temp); $title = $temp[1][0]; preg_match_all('#<img src="([^>]*)">#Us', $item, $temp); $thumb = $temp[1][0]; $ar['date'][$i] = $date; $ar['image'][$i] = str_replace("_5.jpg","_6.jpg",$thumb); $ar['bigimage'][$i] = str_replace("_5.jpg","_7.jpg",$thumb); $ar['link'][$i] = $link; $ar['title'][$i] = $title; echo '<a href="' . $ar['link'][$i] . '" title="' . $ar['title'][$i] .'" target="_blank"><img src="' . $ar['link'][$i] .'" alt="' . $ar['title'][$i] .'"/></a>'; } } getFollowgram(); ?>
  13. This is the method I used to display my latest instagram snaps on my portfolio. Although videos are a no no at the minute. It will just display the cover photo instead. Firstly register with http://followgram.me/. Next add this script were you want the images to appear, change the username and edit the html to fit into your site. <?php function getFollowgram($u) { $url = "http://followgram.me/" . $u . "/rss"; $s = file_get_contents($url); preg_match_all('#<item>(.*)</item>#Us', $s, $items); $ar = array(); for($i=0;$i<count($items[1]);$i++) { $item = $items[1][$i]; preg_match_all('#<link>(.*)</link>#Us', $item, $temp); $link = $temp[1][0]; preg_match_all('#<pubDate>(.*)</pubDate>#Us', $item, $temp); $date = date("d-m-Y H:i:s",strtotime($temp[1][0])); preg_match_all('#<title>(.*)</title>#Us', $item, $temp); $title = $temp[1][0]; preg_match_all('#<img src="([^>]*)">#Us', $item, $temp); $thumb = $temp[1][0]; $ar['date'][$i] = $date; $ar['image'][$i] = str_replace("_5.jpg","_6.jpg",$thumb); $ar['bigimage'][$i] = str_replace("_5.jpg","_7.jpg",$thumb); $ar['link'][$i] = $link; $ar['title'][$i] = $title; echo '<a href="' . $ar['bigimage'][$i] . '" title="' . $ar['title'][$i] .'" target="_blank"><img src="' . $ar['image'][$i] .'" alt="' . $ar['title'][$i] .'"/></a>'; } } getFollowgram(andrew_biggart); ?> Bob's your uncle. BOOM!
  14. Jaxxman1 you're my hero. I had to remove the debug.php part, but it worked a treat. Thanks so much for your help. RewriteEngine On RewriteCond %{REQUEST_URI} ^/blog/$ RewriteCond %{QUERY_STRING} ^tag=([a-z]+)/page/([0-9]+)/$ RewriteRule ^(.*)$ http://example.co.uk/blog/?tag=%1&paged=%2 [R,L]
×
×
  • 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.