lostdeviant

lostdeviant

Joined
Jul 17, 2008
Occupation
Web Design & Publishing
Location
Mexico DF
Interests
Diverse

Activity Stream

lostdeviant commented on a System, Computer Games  -  Feb 12, 2009

Spore is fun until it crashes.

 Respond  
lostdeviant commented on a System, Computer Games  -  Feb 12, 2009

expanded a bit more :-)

 Respond  
lostdeviant   -  Feb 06, 2009

I like Facebook Connect. It rules!

 Respond  
lostdeviant commented on a System, Computer Games  -  Jan 22, 2009

Nice!

 Respond  
lostdeviant created a System  -  Jan 22, 2009
283 
lostdeviant commented on a Page, Extract Search Query from Google HTTP Referer  -  Nov 19, 2008

Nice snippet. I'd love a version for search engines that don't use q=

 Respond  
lostdeviant commented on a Page, Building a Parent/Child Category Structure  -  Aug 26, 2008

Hawkee, Do you recommend any additional columns with the three you mentioned above for the "categories" table?

I'll be using categories with "breadcrumb navigation" on my sites. (at least I hope to)

 Respond  
lostdeviant commented on a Page, Feedback/Contact Email Form  -  Aug 14, 2008

Thank you

 Respond  
lostdeviant commented on a Page, Feedback/Contact Email Form  -  Aug 12, 2008

What would need to be changed to send HTML email messages?

 Respond  
lostdeviant commented on a Page, RSS Feed  -  Jul 17, 2008

I modified this code a little to better learn PHP (I\'m a PHP newbie). Since I currently have each datafeed source in a separate table in my database, I can add a ?x=tablename to pull a feed from that table instead of from the database in general. The description area is modified to work with CSV files from Shareasale, but you could just replace the table names with those from your network.

<?php
// Some RSS readers don\'t like certain characters in the text so this function will replace them with HTML entities
function escape_upper_chars($text) {
// 32-90, 97-122
for ($x = 0; $x < strlen($text); $x++) {
$w = $text{$x};
if ((ord($w) < 32) || ((ord($w) > 90) && (ord($w) < 97)) || (ord($w) > 122)) {
$q .= \'&#\'.ord($w).\';\';
} else {
$q .= $w;
}
}
return $q;
}

$x = mysql_real_escape_string($_GET[x]);
if(!$x) { $x = \'exampletablename\'; }

header(\"Content-type: text/xml\");

// Send the header data
echo \"<?xml version=\\"1.0\\"?><!DOCTYPE rss SYSTEM \\"http://my.netscape.com/publish/formats/rss-0.91.dtd\\">
<rss version=\\"0.91\\">

RSS Feedenhttp://www.website.com RSS Feed Description\\n\"; // Force int data type on $limit to prevent SQL injection attacks $limit = (int)$_GET[\'limit\']; if (($limit < 1) || ($limit > 50)) { $limit = 20; } // Set the default number of results // Query the database (make sure you have included the necessary commands to connect to a MySQL server) $query = \"SELECT Name,Merchant,Link,BigImage,Price,Category,SubCategory,Description,Manufacturer,MerchantCategory,MerchantSubcategory,Num FROM $x ORDER BY Num DESC LIMIT $limit\"; $s = mysql_query($query); // Change the variables here according to your query above while (list($name,$merchant,$link,$bigimage,$price,$category,$subcategory,$description,$manufacturer,$merchantcategory,$merchantsubcategory,$num) = mysql_fetch_row($s)) { $title = escape_upper_chars($name); $description = escape_upper_chars($description); // Customize the data sent to the RSS reader. You should pass text grabbed from the database through escape_upper_chars() echo \"\\n\"; // Begin a new item echo \"$title\\n\"; // Send the title echo \"$link\\n\"; // Send link to the item echo \"<a href=\'$link\'><IMG SRC=\'$bigimage\' alt=\'$title\' align=\'left\' border=\'o\' hspace=\'10px\'></a> $title<br>$description $$price<p>$category - $subcategory - $merchantcategory - $merchantsubcategory From $merchant $manufacturer\\n\"; // Send description echo \"\\n\"; //End the item } echo \"\\n\"; // Close the RSS channel ?>
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.