Wapbuddy is not working properly on my server :sad:
wn i m clicking on next page its not showing me the next page its showing the same page every time.
here u can ck Click Here
but this same script working fine on freehostia.com
can any 1 suggest me what i hv to do ? plz i need ur help 🙁
here iz the code i m using
<?
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
include("../wapbuddy_settings.php");
if (!isset($page)) {$page = 0;}
$total = 0;
if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array();
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
?>
<wml>
<card id="card1" title="<? echo $conf["site_name"] ?>">
<p align="center">[size="1"]
<?
/* editable area */
if(!$partnerid) $partnerid = 11986; // put your partnerID here
$alternate_link = ''; // use this to set a default link if no ad returned
/* end editable area */
//used for ad targeting
$ua = urlencode($_SERVER['HTTP_USER_AGENT']);
$ip = urlencode($_SERVER['REMOTE_ADDR']);
$url = '[url]http://ads.buzzcity.com/show.php?get=1&partnerid='[/url] .
$partnerid . '&a=' . $ua . '&i='.$ip;
@$ad_serve = fopen($url,'r');
$contents = '';
if ($ad_serve) {
while (!feof($ad_serve))
$contents .= fread($ad_serve,1024);
fclose($ad_serve);
}
$link = explode("\n",$contents);
$text = $link[0];
$cid = $link[1];
if ( isset($link) && !empty($link) ) {
//display BuzzCity Ad
echo '<a href="http://click.buzzcity.com/click.php?partnerid=' .
$partnerid . '&cid=' . $cid . '">' . $text . '</a>';
}
else {
//no BuzzCity ad, display alternate
echo $alternate_link;
}
?>
<?php
// change to "live" to disable demo mode and show real ads
define("MOJIVA_MODE", "live");
function mojiva_ad($mojiva_params = array())
{
// prepare url parameters of request
$mojiva_get = 'site='.urlencode('95');
$mojiva_get .= '&ip='.urlencode($_SERVER['REMOTE_ADDR']);
$mojiva_get .= '&ua='.urlencode($_SERVER['HTTP_USER_AGENT']);
$mojiva_get .= '&url='.urlencode(sprintf("http%s://%s%s", (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == TRUE ? "s": ""), $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"]));
$mojiva_get .= '&zone='.urlencode('95');
$mojiva_get .= '&adstype=3'; // type of ads (1 - text only, 2 - images only, 3 - text + images)
$mojiva_get .= '&key=1';
$mojiva_get .= '&count=1'; // quantity of ads
$mojiva_get .= '&keywords='; // keywords to search ad delimited by commas (not necessary)
$mojiva_get .= '&whitelabel=0'; // filter by whitelabel(0 - all, 1 - only whitelabel, 2 - only non-whitelabel
$mojiva_get .= '&premium=0'; // filter by premium status (0 - non-premium, 1 - premium only, 2 - both
$mojiva_get .= '¶mBORDER='.urlencode('#000000'); // ads border color
$mojiva_get .= '¶mHEADER='.urlencode('#cccccc'); // header color
$mojiva_get .= '¶mBG='.urlencode('#eeeeee'); // background color
$mojiva_get .= '¶mTEXT='.urlencode('#000000'); // text color
$mojiva_get .= '¶mLINK='.urlencode('#ff0000'); // url color
if(MOJIVA_MODE == "test") $mojiva_get .= '&test=1';
// send request
$mojiva_request = @fsockopen('ads.mojiva.com', 80, $errno, $errstr, 1);
if ($mojiva_request) {
stream_set_timeout($mojiva_request, 1000);
fwrite($mojiva_request, "GET /ad?".$mojiva_get." HTTP/1.0\r\n");
fwrite($mojiva_request, "Host: ads.mojiva.com\r\n");
fwrite($mojiva_request, "Connection: Close\r\n\r\n");
$mojiva_info = stream_get_meta_data($mojiva_request);
$mojiva_timeout = $mojiva_info['timed_out'];
$mojiva_contents = "";
$mojiva_body = false;
$mojiva_head = "";
while (!feof($mojiva_request) && !$mojiva_timeout) {
$mojiva_line = fgets($mojiva_request);
if(!$mojiva_body && $mojiva_line == "\r\n") $mojiva_body = true;
if(!$mojiva_body) $mojiva_head .= $mojiva_line;
if($mojiva_body && !empty($mojiva_line)) $mojiva_contents .= $mojiva_line;
$mojiva_info = stream_get_meta_data($mojiva_request);
$mojiva_timeout = $mojiva_info['timed_out'];
}
fclose($mojiva_request);
if (!preg_match('/^HTTP\/1\.\d 200 OK/', $mojiva_head)) $mojiva_timeout = true;
if($mojiva_timeout) return "";
return $mojiva_contents;
}
}
?>
<?php
// copy this snippet elsewhere on your page for display more of ads
echo mojiva_ad($mojiva_params);
?>
<small>- - - - [/size]
<?
if ($file_count > 0)
{
$first_record = $page * $conf["items_per_page"];
$last_record = $first_record + $conf["items_per_page"];
while (list($fileIndexValue, $file_name) = each ($file_array))
{
if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{
echo "<img src=\"$file_name\" alt=\"Wait...\"/>
";
echo "<a href=\"../$file_name\">Download It!</a>
";
$total = $total + filesize($file_name);
}
}
echo "<img src=\"http://bdmobi.com/ads/line.gif\" alt=\"*\"/>
";
include("http://bdmobi.com/ads/ad2.php");
echo "
";
echo "<img src=\"http://bdmobi.com/ads/line.gif\" alt=\"*\"/>
";
if (($file_count > 0) AND ($page != 0))
{
// previous button
$prev_page = $page -1;
echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">« Prev Page</a>";
}
echo "|";
if (($file_count > 0) AND ($last_record < $file_count))
{
// next button
$next_page = $page + 1;
echo "[b] <a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">» Next Page »</a>[/b]
";
}
{echo "Click Next Page for more";}
}
closedir($dp);
?>
<a href="http://click.buzzcity.com/click.php?partnerid=11068">
[img]http://ads.buzzcity.com/show.php?partnerid=11068[/img]
</a>
<?
/* editable area */
if(!$partnerid) $partnerid = 11986; // put your partnerID here
$alternate_link = '[url]http://wapnext.com'; [/url] // use this to set a default link if no ad returned
/* end editable area */
//used for ad targeting
$ua = urlencode($_SERVER['HTTP_USER_AGENT']);
$ip = urlencode($_SERVER['REMOTE_ADDR']);
$url = '[url]http://ads.buzzcity.com/show.php?get=1&partnerid='[/url] .
$partnerid . '&a=' . $ua . '&i='.$ip;
@$ad_serve = fopen($url,'r');
$contents = '';
if ($ad_serve) {
while (!feof($ad_serve))
$contents .= fread($ad_serve,1024);
fclose($ad_serve);
}
$link = explode("\n",$contents);
$text = $link[0];
$cid = $link[1];
if ( isset($link) && !empty($link) ) {
//display BuzzCity Ad
echo '<a href="http://click.buzzcity.com/click.php?partnerid=' .
$partnerid . '&cid=' . $cid . '">' . $text . '</a>';
}
else {
//no BuzzCity ad, display alternate
echo $alternate_link;
}
?>
<?php
// copy this snippet elsewhere on your page for display more of ads
echo mojiva_ad($mojiva_params);
?>
[b][url="http://bdmobi.com"]Home > bdmobi.com[/url][/b]
[img]http://c.wen.ru/423006.wbmp?wallpaper[/img]
</small></p>
</card>
</wml>