WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Get TemplateMonster data
Categories : Arrays, Ecommerce, PHP, Strings Click here to Update Your Picture
Olaf Lederer
Date : Mar 17th 2005
Grade : 1 of 5 (graded 2 times)
Viewed : 3894
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Olaf Lederer
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

For more information: visit http://www.templatemonster.com/webapi/
Demo: http://www.finalwebsites.com/demos/retrieve_and_show_templatemonster_data.php

<?php
$num_records
= 4;
$aff_link = "http://www.webertemplates.com/";
$tm_url = "http://www.templatemonster.com/";
$tm_url .= "webapi/templates_screenshots4.php";
$param['last_added'] = "Yes"; // this value is case sensitive
$param['full_path'] = "true";
$param['order'] = "asc";
$param['sort_by'] = "date";
$param['filter'] = "1";
// add additional filters / parameters here
// building querystring from the parameters
$qs = "?";
foreach (
$param as $key => $val) {
   
$qs .= $key."=".$val."&";
}
$qs = rtrim($qs, "&");
// now get the records from the TM webapi
$request_from = $tm_url.$qs;
$all_rows = file($request_from);
// now split the data for each row into an multi dim. array
for ($i = 0; $i < $num_records; $i++) {
   
$data[$i] = explode("\t", $all_rows[$i]);
}
$t_row = "<div id=\"thumbs\">\n";
foreach (
$data as $row) {
   
// read the information about more attr.
   
$id = $row[0];
   
$price = $row[1];
   
$all_images = explode(",", trim($row[15], "{}"));
   
$t_row .= "  <div class=\"thumb\">\n";
   
$t_row .= "    <div class=\"box\">\n";
    foreach (
$all_images as $img) {
        if (
preg_match("/-m.jpg$/", $img)) {
           
$thumb = $img;
        }
    }
   
$thumb_size = getimagesize($thumb);
   
$t_row .= "      <a href=\"".$aff_link."\" target=\"_blank\">";
   
$t_row .= "<img src=\"".$thumb."\" ".$thumb_size[3]." border=\"0\" alt=\"template no. ".$id."\">\n";
   
$t_row .= "</a>\n";
   
$t_row .= "    </div>\n";
   
$t_row .= "    <p>Price: $".$price."</p>\n";
   
$t_row .= "  </div>\n";
}
$t_row .= "</div>";
// How to use? Just "echo $t_row" inside the documents body.
echo $t_row;
?>



Takes an array and returns a string, suitable for inputing in an SQL statement
Categories : Arrays, Strings, PHP
columned txt file to array()?
Categories : Arrays, Strings, Regexps, PHP
How to ifconfig down/up a list of IP's
Categories : Arrays, Strings, Filesystem, PHP
Grab images from one or more URLs and save them to a specified local directory.
Categories : PHP, Filesystem, Strings, Arrays
Function to create a separated list
Categories : PHP, Arrays, Strings
Variable serialization and unserialization. Loading and saving variable structures to and from file.
Categories : Arrays, Filesystem, Variables, Strings, PHP
Compare two texts and display a block of text with the differences between them.
Categories : PHP, PHP Classes, Filesystem, Strings, Arrays
WWW interface to Unix Manual(phpMan)
Categories : Program Execution, Strings, Arrays, PHP
How to Get a character array from a string
Categories : PHP, Strings, Arrays
Can the word DO be used in arrays?
Categories : Arrays, PHP, Strings
Authorize.net AIM Interface Class v1.0.0
Categories : PHP, PHP Classes, Ecommerce, Payment Gateways
phpAds, a complete banner and ad management system with detailled tracking and stats.
Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases
open source online php shop project ecommerce commerce
Categories : PHP, Ecommerce
clearing variables in php3
Categories : Variables, Arrays, PHP
Avoiding or Detecting high bit characters in a string. Useful when you want to create a valid RSS feed
Categories : PHP, Strings, Unicode, Regexps, Rich Site Summary (RSS)