cobrax Posted October 12, 2009 Share Posted October 12, 2009 Hi, is it posible to download my complete list of hosting packages in a nice html sheet so also when i my updates that it wil chance on the page that it displays so short i need php or html code that download my hosting packages and prices to a php or html page ho can i do that please help me out. regards g.roos 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted October 12, 2009 Share Posted October 12, 2009 You will need to do a bit with this but: nclude("configuration.php"); // Insert here the the title of your feed $rss_title= ".com RSS feed"; // Insert your site, in the format site.com $rss_site= ".com" ; // Insert the description of your website $rss_description= "Description of your RSS feed"; // Applicable language of the feed. For spanish, change to "es" $rss_language="en"; // Address of the logo file. It can be called whatever you want it to be! $rss_logo="http://www.".$rss_site."/images/rss.gif"; // the feed's author email $emailadmin="your@emailaddress.com"; // set the file's content type and character set // this must be called before any output header("Content-Type: text/xml;charset=utf-8"); // Open the database mysql_connect($db_host,$db_username,$db_password); @mysql_select_db($db_name) or die("Unable to select DB"); // Select all the records from the Articles/Blog table - whatever you're using it for $query = " Select tblproducts.`id`, tblproducts.`type`, tblproducts.`gid`, tblproducts.`name`, tblproducts.`description`, tblproducts.`hidden`, tblproducts.`showdomainoptions`, tblproducts.`welcomeemail`, tblproducts.`stockcontrol`, tblproducts.`qty`, tblproducts.`proratabilling`, tblproducts.`proratadate`, tblproducts.`proratachargenextmonth`, tblproducts.`paytype`, tblproducts.`subdomain`, tblproducts.`autosetup`, tblproducts.`servertype`, tblproducts.`defaultserver`, tblproducts.`configoption1`, tblproducts.`configoption2`, tblproducts.`configoption3`, tblproducts.`configoption4`, tblproducts.`configoption5`, tblproducts.`configoption6`, tblproducts.`configoption7`, tblproducts.`configoption8`, tblproducts.`configoption9`, tblproducts.`configoption10`, tblproducts.`configoption11`, tblproducts.`configoption12`, tblproducts.`configoption13`, tblproducts.`configoption14`, tblproducts.`configoption15`, tblproducts.`configoption16`, tblproducts.`configoption17`, tblproducts.`configoption18`, tblproducts.`configoption19`, tblproducts.`configoption20`, tblproducts.`configoption21`, tblproducts.`configoption22`, tblproducts.`configoption23`, tblproducts.`configoption24`, tblproducts.`freedomain`, tblproducts.`freedomainpaymentterms`, tblproducts.`freedomaintlds`, tblproducts.`upgradepackages`, tblproducts.`configoptionsupgrade`, tblproducts.`billingcycleupgrade`, tblproducts.`tax`, tblproducts.`affiliateonetime`, tblproducts.`affiliatepaytype`, tblproducts.`affiliatepayamount`, tblproducts.`downloads`, tblproducts.`order`, tblproductgroups.`id`, tblproductgroups.`name` As `groups name`, tblproductgroups.`disabledgateways`, tblproductgroups.`hidden`, tblproductgroups.`order`, tblpricing.`id`, tblpricing.`type`, tblpricing.`currency`, tblpricing.`relid`, tblpricing.`msetupfee`, tblpricing.`qsetupfee`, tblpricing.`ssetupfee`, tblpricing.`asetupfee`, tblpricing.`bsetupfee`, tblpricing.`monthly`, tblpricing.`quarterly`, tblpricing.`semiannually`, tblpricing.`annually`, tblpricing.`biennially` From (tblproducts tblproducts LEFT OUTER JOIN tblproductgroups tblproductgroups ON (tblproducts.gid = tblproductgroups.id)) LEFT OUTER JOIN tblpricing tblpricing ON (tblpricing.relid = tblproducts.id) Where ( tblproductgroups.hidden <> 'on' ) And ( tblpricing.`currency` = 1 ) And ( tblpricing.type = 'product' ) Order by tblproductgroups.id Asc " ; $result = mysql_query($query) or die("Query failed") ; $num_rows = mysql_num_rows($result); echo '<?xml version="1.0" encoding="utf-8" ?> <channel> <title>'.$rss_title.'</title> <link>http://www.'.$rss_site.'</link> <description>'.$rss_description.'</description>'; for($i=0;$i<$num_rows; $i++) //will loop through 500 times to generate 500 RSS items { $photo_name = 'where-ever a photo for this article could be found - needs to be http://www.yoursite.com/images/whatever.gif'; $title = mysql_result($result,$i,'name'); //subject line for the RSS item $groupsname = mysql_result($result,$i,'groups name'); // Pass the record URL_product to the variable $url_product. It also // has to include the relative path, like in: "path/product1.htm" $productinfopid = mysql_result($result,$i,'id'); $url_product = '/cart.php?a=add&pid='.$productinfopid.''; //define the URL of where people could read this blog/article entry $url_product_image = '/templates/new_portal/images/products/'.$productinfopid.'.jpg'; //define the URL of where people could read this blog/article entry // Define a description of the item http://westonehosting.com/cart.php?a=add&pid=85 $description = mysql_result($result,$i,'description'); //easiest way is by grabbing the content // Clean the description $description = str_replace ("&","",htmlspecialchars(strip_tags($descripti on))); $description = str_replace ("nbsp;","",htmlspecialchars(strip_tags($descripti on))); //This is a teaser of your article, basically what RSS readers will show the user in their inbox. //This is how you entice users to come over and read the full article //the easiest way is to just take the first few hundred characters of the content (description) $short_description = substr($description,0,50) . "..."; $mygid = mysql_result($result,$i,'gid'); $mypid = mysql_result($result,$i,'id'); //outputs the RSS item groups name echo ' <item> <title>'.$title.'</title> <description>'.$description.'</description> <link>http://www.'.$rss_site.$url_product.'</link> <guid>http://www.'.$rss_site.$url_product.'</guid> </item> '; } //end of the for-loop mysql_close(); //close the DB echo //close the XML file ' </channel> </rss>'; I am not saying this will work out-the-box. If you get it working let me now. 0 Quote Link to comment Share on other sites More sharing options...
cobrax Posted October 12, 2009 Author Share Posted October 12, 2009 ok i wil try it tonight verry helpfull i think it could be a nice php for the integration code part 0 Quote Link to comment Share on other sites More sharing options...
cobrax Posted October 12, 2009 Author Share Posted October 12, 2009 its full of errors and now after // som lines i get this: XML-parsefout: syntaxisfout Locatie: http://scriptmarketplace.org/webhosting/webhostingtest.php Regelnummer 1, kolom 1:Query failed ^ so maybe the code must be altered my test file is now this <?php include("members/configuration.php"); // Insert here the the title of your feed $rss_title= ".com RSS feed"; // Insert your site, in the format site.com $rss_site= ".com" ; // Insert the description of your website $rss_description= "Description of your RSS feed"; // Applicable language of the feed. For spanish, change to "es" $rss_language="en"; // Address of the logo file. It can be called whatever you want it to be! $rss_logo="http://www.".$rss_site."/images/rss.gif"; // the feed's author email $emailadmin="your@emailaddress.com"; // set the file's content type and character set // this must be called before any output header("Content-Type: text/xml;charset=utf-8"); // Open the database mysql_connect($db_host,$db_username,$db_password); @mysql_select_db($db_name) or die("Unable to select DB"); // Select all the records from the Articles/Blog table - whatever you're using it for $query = " Select tblproducts.`id`, tblproducts.`type`, tblproducts.`gid`, tblproducts.`name`, tblproducts.`description`, tblproducts.`hidden`, tblproducts.`showdomainoptions`, tblproducts.`welcomeemail`, tblproducts.`stockcontrol`, tblproducts.`qty`, tblproducts.`proratabilling`, tblproducts.`proratadate`, tblproducts.`proratachargenextmonth`, tblproducts.`paytype`, tblproducts.`subdomain`, tblproducts.`autosetup`, tblproducts.`servertype`, tblproducts.`defaultserver`, tblproducts.`configoption1`, tblproducts.`configoption2`, tblproducts.`configoption3`, tblproducts.`configoption4`, tblproducts.`configoption5`, tblproducts.`configoption6`, tblproducts.`configoption7`, tblproducts.`configoption8`, tblproducts.`configoption9`, tblproducts.`configoption10`, tblproducts.`configoption11`, tblproducts.`configoption12`, tblproducts.`configoption13`, tblproducts.`configoption14`, tblproducts.`configoption15`, tblproducts.`configoption16`, tblproducts.`configoption17`, tblproducts.`configoption18`, tblproducts.`configoption19`, tblproducts.`configoption20`, tblproducts.`configoption21`, tblproducts.`configoption22`, tblproducts.`configoption23`, tblproducts.`configoption24`, tblproducts.`freedomain`, tblproducts.`freedomainpaymentterms`, tblproducts.`freedomaintlds`, tblproducts.`upgradepackages`, tblproducts.`configoptionsupgrade`, tblproducts.`billingcycleupgrade`, tblproducts.`tax`, tblproducts.`affiliateonetime`, tblproducts.`affiliatepaytype`, tblproducts.`affiliatepayamount`, tblproducts.`downloads`, tblproducts.`order`, tblproductgroups.`id`, tblproductgroups.`name` As `groups name`, tblproductgroups.`disabledgateways`, tblproductgroups.`hidden`, tblproductgroups.`order`, tblpricing.`id`, tblpricing.`type`, tblpricing.`currency`, tblpricing.`relid`, tblpricing.`msetupfee`, tblpricing.`qsetupfee`, tblpricing.`ssetupfee`, tblpricing.`asetupfee`, tblpricing.`bsetupfee`, tblpricing.`monthly`, tblpricing.`quarterly`, tblpricing.`semiannually`, tblpricing.`annually`, tblpricing.`biennially` From (tblproducts tblproducts LEFT OUTER JOIN tblproductgroups tblproductgroups ON (tblproducts.gid = tblproductgroups.id)) LEFT OUTER JOIN tblpricing tblpricing ON (tblpricing.relid = tblproducts.id) Where ( tblproductgroups.hidden <> 'on' ) And ( tblpricing.`currency` = 1 ) And ( tblpricing.type = 'product' ) Order by tblproductgroups.id Asc " ; $result = mysql_query($query) or die("Query failed") ; $num_rows = mysql_num_rows($result); echo '<?xml version="1.0" encoding="utf-8" ?> <channel> <title>'.$rss_title.'</title> <link>http://www.'.$rss_site.' <description>'.$rss_description.'</description>'; //for($i=0;$i<$num_rows; $i++) //will loop through 500 times to generate 500 RSS items { $photo_name = 'where-ever a photo for this article could be found - needs to be http://www.yoursite.com/images/whatever.gif'; $title = mysql_result($result,$i,'name'); //subject line for the RSS item $groupsname = mysql_result($result,$i,'groups name'); // Pass the record URL_product to the variable $url_product. It also // has to include the relative path, like in: "path/product1.htm" $productinfopid = mysql_result($result,$i,'id'); $url_product = '/cart.php?a=add&pid='.$productinfopid.''; //define the URL of where people could read this blog/article entry $url_product_image = '/templates/new_portal/images/products/'.$productinfopid.'.jpg'; //define the URL of where people could read this blog/article entry // Define a description of the item http://westonehosting.com/cart.php?a=add&pid=85 $description = mysql_result($result,$i,'description'); //easiest way is by grabbing the content // Clean the description // $description = str_replace ("&","",htmlspecialchars(strip_tags($descripti on))); // $description = str_replace ("nbsp;","",htmlspecialchars(strip_tags($descripti on))); //This is a teaser of your article, basically what RSS readers will show the user in their inbox. //This is how you entice users to come over and read the full article //the easiest way is to just take the first few hundred characters of the content (description) // $short_description = substr($description,0,50) . "..."; $mygid = mysql_result($result,$i,'gid'); $mypid = mysql_result($result,$i,'id'); //outputs the RSS item groups name echo ' <item> <title>'.$title.'</title> <description>'.$description.'</description> <link>http://www.'.$rss_site.$url_product.' <guid>http://www.'.$rss_site.$url_product.'</guid> </item> '; } //end of the for-loop mysql_close(); //close the DB echo //close the XML file ' </channel> </rss>'; ?> 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted October 12, 2009 Share Posted October 12, 2009 so dose this code you posted work now? If so could you also get it to make a .xml file to? As I was trying to make a google product feed with it. 0 Quote Link to comment Share on other sites More sharing options...
cobrax Posted October 13, 2009 Author Share Posted October 13, 2009 no this code was not working for me there are to manny error's that i not get solved 0 Quote Link to comment Share on other sites More sharing options...
cobrax Posted October 13, 2009 Author Share Posted October 13, 2009 or what is the exact tpl code to display al hosting procts inclued prices becouse php icannot find it out how to do 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.