Devam Ediyor

JoMo PPC Plugin

I need a search plugin for 'JoMo Easy Pay-Per-Click Search Engine' ([url removed, login to view] ) that will retrieve search results from 'Google' and '[url removed, login to view]'.

I have enclosed a plugin for '[url removed, login to view]', as an example:

pluginName="Altavista";

$this->init();

}

function init(){

global $dbObj;

$dbSet=new xxDataset($dbObj);

$table = "adminoptions";

/*

INSERT INTO adminoptions VALUES ('maxAltavistaCount', '50', 'Altavista: max links', 'Search sites', 'string');

INSERT INTO adminoptions VALUES ('searchAltavista', '0', 'Altavista: enable', 'Search sites', 'yesno');

*/

// check options

$cat = "Search sites";

if (!$this->isExistOption("searchAltavista"))

$this->insertOption(array("optionName"=>"searchAltavista","value"=>0,"description"=>"Altavista: enable","optionCategory"=>$cat,"optionType"=>"yesno"));

if (!$this->isExistOption("maxAltavistaCount"))

$this->insertOption(array("optionName"=>"maxAltavistaCount","value"=>0,"description"=>"Altavista: max links","optionCategory"=>$cat,"optionType"=>"string"));

}

function addPlugin(&$plugins){

$plugins[]=array("name"=>"ahha", "classname"=>"CSearch_Ahha");

}

function isEnable(){

$opt = getOption("searchAltavista");

if ($opt==1) return 1;

else return 0;

}

function getMaxCount(){

$maxCount = getOption("maxAltavistaCount");

return $maxCount;

}

function getLinks($str, $from ,$count, &$error){

//dprint("av find from $from, count=$count");

if ($this->isEnable()==0) return 0;

$maxCount = $this->getMaxCount();

$str = stripslashes($str);

if ($from > $maxCount)

return array("count"=>$from,"totalLinks"=>$maxCount, "links"=>array());

$count = $from + $count > $maxCount ? $maxCount-$from : $count;

$page1 = floor($from/10);

$page2 = floor(($from+$count-1)/10);

$start = $page1*10;

$found = 0; $total=0;

$index = 0;

$links=array();

for ($p=$page1; $pgetPart($str, $p*10, 10,$error);

if (empty($res)) break;

$found += $res["count"];

$total = $res["totalLinks"];

$links = array_merge($links, $res["links"]);

}

$links = array_slice($links, $from-$start,$count);

$found = sizeof($links);

$result["links"]=$links;

$result["count"]=$found>$maxCount?$maxCount:$found;

$result["totalLinks"]=$total>$maxCount?$maxCount:$total;

return $result;

}

function getPart($str, $from, $count, &$error){

global $Error;

global $items, $index;

global $_count, $_startcount;

//dprint("avf: str=$str, from=$from");

$str = urlencode($str);

//$filename = "[url removed, login to view];.$str."&pg=q&avkw=qtrp&kl=XX&stq=$from";

$filename = "[url removed, login to view];.$str."&avkw=rf&stq=$from";

//$filename = "test_av1.htm";

$Error->silence();

$ff = @file($filename);

$Error->restore();

if (!$ff) {

return false;

}

$text = join('',$ff);

$items = array();

$text = preg_replace("/n|t|r/ims","",$text);

$text = preg_replace("/|/ims","",$text);

//$text = preg_replace("/|/ims","",$text);

$text = preg_replace("/|]*>/ims","",$text);

$text = preg_replace("//ims","",$text);

$text = preg_replace("/&nbsp/ims","",$text);

//echo $text;

$founds = array();

$pattern = "/";

// count

$pattern .= "altavista found +([0-9,]+) +resultss*(.*)";

$pattern.="/ims";

$t = preg_match_all($pattern, $text, $founds);

if (!$t){ /*dprint("no matches 1");*/ return 0; }

$text = $founds[2][0];

$cs = $founds[1][0];

$avcount = preg_replace("/[s,]+/im","",$cs);

//dprint("count=$avcount");

// dprint("text=".$text);

$pattern = "/";

$pattern .= "]*>s*()?s*]*)?s*href="([^">]*)"[^>]*>";

$pattern .= "([^]*)";

$pattern .= "([^]*]*>s*)?[^]*]*>([^]*)AV:results");

// print_r($founds);

//print_r($founds[4]);

$refs = $founds[3];

$titles = $founds[4];

$descrs = $founds[7];

//print_r($refs);

//$linkAttributes = array('title','url','linkURL', 'description', 'bid');

$_count=sizeof($refs);

for ($i=0;$i0, "url"=>$url, "linkURL"=>$url,

"title"=>$titles[$i], "description"=>$descrs[$i], "bid"=>0, "pluginName"=>$this->pluginName);

$items[] = $item;

}

$result["totalLinks"] = $avcount;

$result["count"] = $_count;

$result["links"] = $items;

$error = "";

return $result;

}

};

$search_plugins[]=array("name"=>"Altavista", "classname"=>"CSearch_Altavista", "object"=>new CSearch_Altavista);

/*

$str = "business";

$from = 0;

$page=1;

$error = "";

$links = parseLinks_altavista($str, $from, $error);

echo "$error";

print_r($links);

*/

Best Regards

Stuart

Beceriler: PHP, XML

Daha fazlasını görün: ppc plugin, plugins search web ppc, value options, text string search, str pattern, search text string, q find, php pg, pattern string, index php cat, global p, string pattern, sizeof string, business name search engine, altavista search engine, ppc plugins, jomo ppc, cool ppc plugins, pay p, max p, best ppc, best pay per click, xml php array, web q, str

İşveren Hakkında:
( 5 değerlendirme ) chichester, United Kingdom

Proje NO: #5038

Seçilen:

worldnetweb

Hello, Stuart. Please see PM for details on our bid. Regards.

2 gün içinde 60$ USD
(4 Değerlendirme)
3.6