The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I don't know how many of you have used Prosperent.com on your sites, but they have an awesome product API that lets you pull back products based on a keyword. When someone buys one of the products, you get a commission. I've been using their regular TCPA ads for a few months on my automotive sites and i've made quite a bit of money, but I think I (and everyone here) can make a great deal more if we can integrate their API into vbulletin as a plugin. I started on this basic idea of doing a product search engine. I have it working, but now I need to convert it into something that will work with Vbulletin and I have no idea how to register the variables with Vbulletin (and I did read the article on it). So, if anyone is willing to take a look, I want to keep the whole project open source.
Here is the results page I need help converting: Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv=content-type content="text/html; charset=utf-8"> <title> <?=$trimmed?> - Prosperent Product Search</title> <link type="text/css" rel="stylesheet" href="http://www.highaltitudeimports.com/search/css/prosperent_css.css"> <link type="text/css" rel="stylesheet" href="http://www.highaltitudeimports.com/search/css/prosperent_css1.css"> <!--[if lte IE 7]> <style>.rsaquo{margin-top:-2px}.grid .result,.ps-sprite{display:inline;zoom:1}.ps-sprite{font-size:1px}.grid{zoom:1}.grid .result-cont {vertical-align: baseline}#lhs-ref {left: 8px}</style> <![endif]--> <style type=text/css> #gbar, #guser { font-size:13px; padding-top:1px !important } #gbar { float:left; height:22px } #guser { padding-bottom:7px !important; text-align:right } .gbh, .gbd { border-top:1px solid #c9d7f1; font-size:1px } .gbh { height:0; position:absolute; top:24px; width:100% } #gbs, .gbm { background:#fff; left:0; position:absolute; text-align:left; visibility:hidden; z-index:1000 } .gbm { border:1px solid; border-color:#c9d7f1 #36c #36c #a2bae7; z-index:1001 } .gb1 { margin-right:.5em } .gb1, .gb3 { zoom:1 } .gb2 { display:block; padding:.2em .5em } .gb2, .gb3 { text-decoration:none; border-bottom:none } a.gb1, a.gb2, a.gb3, a.gb4 { color:#00c !important } .gbi .gb3, .gbi .gb2, .gbi .gb4 { color:#dd8e27 !important } .gbf .gb3, .gbf .gb2, .gbf .gb4 { color:#900 !important } a.gb2:hover { background:#36c; color:#fff !important } </style> </head> <body> <div > <div id="srp-header" > <? function extractFirst($text,$num=3) { // Create array of sentences using period as the divider $words = explode('.',$text); $extract = ''; if (count($words) > 1) { // Rebuild, using number defined by $num, and adding period back in. for ($i=0;$i<$num;$i++) { $extract .= $words[$i].'.'; } } else { $extract = $words[0].'.'; } return $extract; } $var = @$_GET['q'] ; // get the query for the search engine (if applicable) $trimmed = trim($var); //trim whitespace from the stored variable if($q == true) { ?> <form method="GET" action="<?=$PHP_SELF?>" name="search"> <table> <tr> <td><a id="srp-logo" href="http://www.highaltitudeimports.com" title="Prosperent Search"> <img width="167" height="222" alt="Prosperent" src="http://www.highaltitudeimports.com/search/img/nav_logo13.png" /> </a></td> <td><table id="search-input" cellspacing="0"> <tr> <td class="srchBoxCont" nowrap><input class="srch_box" maxlength="2048" name="q" size="41" value="<?=$trimmed?>" title="Search Products"></td> <td nowrap><div class="srchButtonRightShadow"> <div class="srchButtonBorder"> <input class="srch_button" type="submit" value="Search" id="srchButton"> </div> </div></td> </tr> <tr> <td colspan="2" class="search_advanced"><a href="/" id="advsearch" ></a></td> </tr> </table></td> </tr> </table> </form> <? } elseif($q == false) { ?> <form method="GET" action="<?=$PHP_SELF?>" name="search"> <table> <tr> <td><a id="srp-logo" href="http://www.highaltitudeimports.com" title="Prosperent Search"> <img width="167" height="222" alt="Prosperent" src="http://www.highaltitudeimports.com/search/img/nav_logo13.png" /> </a></td> <td><table id="search-input" cellspacing="0"> <tr> <td class="srchBoxCont" nowrap><input class="srch_box" maxlength="2048" name="q" size="41" value="search" title="Search Products"></td> <td nowrap><div class="srchButtonRightShadow"> <div class="srchButtonBorder"> <input class="srch_button" type="submit" value="Search" id="srchButton"> </div> </div></td> </tr> <tr> <td colspan="2" class="search_advanced"><a href="/" id="advsearch" ></a></td> </tr> </table></td> </tr> </table> </form> <? } ?> </div> <div id="result-count"> </div> <div id="lhs-ref"> <div class="lhs-group" id="ref-brand"> <p class="ref_active"><span class="rsaquo">›</span>More Results:</p> <ul class="popular-ref"> </ul> </div> </div> <div class="list lhs"> <div class="content-cont"> <div id="ads-top"> <ol> <li class="first"> <script type="text/javascript"><!-- prosperent_uid = 214536; /*HAI Search Page*/ prosperent_unit = 8473674; prosperent_ad_width = 468; prosperent_ad_height = 60; prosperent_custom_query = '<?=$trimmed?>'; //--> </script> <script type="text/javascript" src="http://prosperent.com/js/ad.js"> </script> </li> </ol> </div> <div id="view-sort"> <div class="fr view-sort-cont"> <nobr>Sort by:</nobr> <select name=scoring onchange="window.location='\x2Fproducts?q=shoes\x26show=dd&scoring='+this.options[this.selectedIndex].value;"> <option value="r" selected>Relevance <option value="p">Price: low to high <option value="pd">Price: high to low </select> <p class="clear_right"></p> </div> <?php require_once('Prosperent_Api.php'); $prosperentApi = new Prosperent_Api(array( 'api_key' => 'db08d33e981e05fdd1bd39de70a85248', 'query' => $trimmed, 'visitor_ip' => $_SERVER['REMOTE_ADDR'], 'channel_id' => 0, 'page' => 1, 'limit' => 10 )); $prosperentApi->set_debugMode(true); $results = $prosperentApi->fetch(); foreach ($results['data'] as $record) { ?> <ol id="results"> <li class="result" id="res0"> <div class="result-cont"> <p class="result-image"> <a href="<?=$record['affiliate_url']?>" ><img src="<?=$record['image_url']?>" width="90" alt="<?=$record['keyword']?>" title="<?=$record['keyword']?>"></a> </p> <div class="result-price-seller"> <p class="result-price" id="price0"> <span class="main-price">$ <?=$record['price']?> </span> </p> <div class="result-seller"> <cite> <?=$record['merchant']?> </cite> </div> </div> <div class="result-title-description"> <h3 class="result-title"> <a href="<?=$record['affiliate_url']?>" > <?=$record['keyword']?> </a> </h3> <p class="result-description"> <?=extractFirst($record['description'])?> <b>...</b>. </p> <div class="result-rating"> </div> </div> </div> </li> </ol> <? } ?> <div id="visual_tools"> <div class="v-ref-sixpack"> <div class="v-ref-hdr">Shop by brand</div> <div class="v-ref-hdr"></div> <?php require_once('Prosperent_Api.php'); $prosperentApi = new Prosperent_Api(array( 'api_key' => 'db08d33e981e05fdd1bd39de70a85248', 'query' => $trimmed, 'visitor_ip' => $_SERVER['REMOTE_ADDR'], 'channel_id' => 0, 'page' => 1, 'limit' => 6 )); $prosperentApi->set_debugMode(true); $results = $prosperentApi->fetch(); foreach ($results['data'] as $record) { ?> <div class="v-ref"> <div class="v-ref-img"><a href="<?=$record['affiliate_url']?>" ><img src="<?=$record['image_url']?>" width="90" alt="<?=$record['keyword']?>" title="<?=$record['keyword']?>"></a></div> <a href="<?=$record['affiliate_url']?>" > <?=$record['brand']?> </a> </div> <? } ?> <p class="clear"></p> </div> </div> <div id="ads-bot"> <ol> <li class="first"> <script type="text/javascript"><!-- prosperent_uid = 214536; /*HAI Search Page*/ prosperent_unit = 8473674; prosperent_ad_width = 468; prosperent_ad_height = 60; prosperent_custom_query = '<?=$trimmed?>'; //--> </script> <script type="text/javascript" src="http://prosperent.com/js/ad.js"> </script> </li> </ol> </div> </div> <div class="below-content"> <div id="ps-navbar" class="n"> <table width="1%"> <tr> <td nowrap align="right"> </td> <td nowrap>Page Nav</td> <td valign=bottom nowrap> </td> </tr> </table> </div> <div id="footer"> <div id="footer-bg"> <? if($q == true) { ?> <form method="get" name="fb" action="<?=$PHP_SELF?>"> <table cellspacing="0"> <tr> <td class="srchBoxCont" nowrap><input class="srch_box" type="text" name="q" size="40" maxlength="2048" value="<?=$trimmed?>"></td> <td nowrap><div class="srchButtonRightShadow"> <div class="srchButtonBorder"> <input class="srch_button" type="submit" value="Search" id="srchButtonB"> </div> </div></td> </tr> </table> </form> <? } elseif($q == false) { ?> <form method="get" name="fb" action="<?=$PHP_SELF?>"> <table cellspacing="0"> <tr> <td class="srchBoxCont" nowrap><input class="srch_box" type="text" name="q" size="40" maxlength="2048" value="search"></td> <td nowrap><div class="srchButtonRightShadow"> <div class="srchButtonBorder"> <input class="srch_button" type="submit" value="Search" id="srchButtonB"> </div> </div></td> </tr> </table> </form> <? } ?> </div> <p class="bottom-links"> <a href="/" id="gHome">Home</a> <a href="http://www.Prosperent.coml">About </a></p> <div align="center">Powered by:<a href="http://www.prosperent.com">Prosperent</a></div> </div> </div> </div> <p class="clear"></p> </div> </body> </html> |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|