The new code looks as follows.
[php]
<?php
include("./../Admin-panel/tracker/tracker.php");
$selfPost = $_SERVER['PHP_SELF'];
$limit = $_REQUEST['l'];
if(!isset($limit)){$limit=5;}
if(isset($_POST['user_strain'])){$user_strain = $_POST['user_strain'];}
if(isset($_GET['user_strain'])){$user_strain = $_GET['user_strain'];}
if(!isset($user_strain)){
$content = file_get_contents("http://budgenius.com/search.html?&pp=$limit");
}else{
$user_strain = str_replace(" ","_",$user_strain);
$content = file_get_contents("http://budgenius.com/search.html?cmd=search&query=$user_strain&submit=Strain+ID+Search&pp=$limit");
}
?>
Search
Seach for:
<?php
$statscolor = "white";
$start = strpos($content,'
');
$end = strpos($content,'
', $start);
if(!$start){
$start = strpos($content,'
');
$end = strpos($content,'
', $start);
$table = substr($content,$start,$end-$start);
}else{
$table = substr($content,$start,$end-$start);
$table = preg_replace("/<img[^>]+>/i", “”, $table);
$table = str_replace(’<div class=“ssli_left_image” style=“background: url(’,’
<img src=“
http://budgenius.com’,$table);
$table = str_replace(’) no-repeat left top;’,”’”,$table);
$table = str_replace(’
’,’<div ondragstart="OnDragStart (event)"class=“special_strain_list_item ui-draggable testThing” ">’,$table);
$table = str_replace(’
’,’
’,$table);
$table = str_replace(’
’,’
’,$table);
$table = str_replace(’
’,’
’,$table);
$table = str_replace(’
’,’
’,$table);
$table = str_replace(’
’,’
’,$table);
$table = str_replace(’
’,’
’,$table);
$table = str_replace(’
’,’
’,$table);
$table = str_replace(’
’,’
’,$table);
$table = str_replace(’
’,’
’,$table);
$table = str_replace(’’,’’,$table);
$table = str_replace(’’,’’,$table);
}
echo <<<EOF
body{
background-color:black;
}
.testThing{
background-color:;
filter:alpha(opacity=95);
opacity: 0.80;
-moz-opacity:0.80;
float:left;
width;185px;
border-style:solid;
border-color:yellow;
border-width:5px;
}
#savedstrain{
background-color:;
filter:alpha(opacity=95);
opacity: 0.80;
-moz-opacity:0.80;
float:left;
width;185px;
border-style:solid;
border-color:yellow;
border-width:5px;
}
.none{
display:none;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
}
table {
border-collapse:collapse;
border-spacing:0;
}
fieldset,img {
border:0;
}
address,caption,cite,code,dfn,em,strong,th,var {
font-style:normal;
font-weight:normal;
}
ol,ul {
list-style:none;
}
caption,th {
text-align:left;
}
h1,h2,h3,h4,h5,h6 {
font-size:100%;
font-weight:normal;
}
q:before,q:after {
content:'';
}
abbr,acronym { border:0;}
EOF;
if($start == strpos($content,'
')){
echo<<<EOF
EOF;
}else{
echo<<<EOF
EOF;
}
echo <<<EOF
click and drag your favorite strain!
EOF;
$row = explode("", $table,-1);
$i=0;
foreach($row as $strain){
echo '
'.$strain.'
';
$i++;
}
echo <<<EOF
EOF;
$saved_strain = $_POST["str"];
if($saved_strain){
echo $saved_strain;
}else{
echo 'Nothing Saved';
}
echo<<<EOF
EOF;
?>
[/php]