$refresh, 'display' => 'Plugin Downloads Schedule'); return $recc; } /* This is the scheduling hook for our plugin that is triggered by cron */ add_action('dprx_pldl_hook','dprx_pldl_trigger_schedule'); function dprx_pldl_trigger_schedule() { dprx_pldl_parser(); } /* Schedules are activated and deactivated */ add_action('init', 'dprx_pldl_setoptions'); function dprx_pldl_setoptions() { if (!empty($_POST['dprx_pldl_wporguser'])) { update_option("dprx_pldl_wporguser",$_POST['dprx_pldl_wporguser']); if (!empty($_POST['dprx_pldl_refresh'])) { $timestamp = wp_next_scheduled('dprx_pldl_hook', array()); /* This is where the event gets unscheduled */ wp_unschedule_event($timestamp, "dprx_pldl_hook", array()); update_option("dprx_pldl_refresh",$_POST['dprx_pldl_refresh']); $refresh = get_option("dprx_pldl_refresh"); $refresh = $refresh*3600; /* This is where the actual recurring event is scheduled */ if (!wp_next_scheduled('dprx_pldl_hook', array())) { wp_schedule_event(time()+$refresh, "dprx_pldl_recc", "dprx_pldl_hook", array()); } } dprx_pldl_parser(); } } function dprx_pldl_update_button() { ?>

" onclick=" document.getElementById('dprx_plugindownloadsdiv').innerHTML='/wp-content/plugins/backupwordpress/images/loading.gif /> '; new Ajax.Updater( 'dprx_plugindownloadsdiv', '/wp-admin/index.php?page=', {method: 'get', parameters:'dprx_pldldo_ajax=1'} );" />

/wp-admin/index.php?page=plugin-downloads/plugin-downloads.php">

: " name="dprx_pldl_wporguser" id="dprx_pldl_wporguser" /> " name="dprx_pldl_refresh" id="dprx_pldl_refresh" /> " />

$row) { $sort = get_option("dprx_pldl_sort"); if (empty($sort)) { $sort = "downloads"; } $dl[$key] = $row[$sort]; } $sortorder = get_option("dprx_pldl_sortorder"); if ($sortorder == "SORT_DESC") { array_multisort($dl, SORT_ASC, $data); } else { array_multisort($dl, SORT_DESC, $data); } ?>
&sort=title&sortorder="> &sort=updated&sortorder="> &sort=downloads&sortorder=">
fetch($uri); $data = $client->results; //preg_match ("/
([^`]*?)<\/div>/", $match, $temp) preg_match_all("/
([^`]*?)<\/div>/", $data, $m); // parser starts $stripped = ""; foreach($m[0] as $d) { preg_match_all ("/a[\s]+[^>]*?href[\s]?=[\s\"\']+(.*?)[\"\']+.*?>"."([^<]+|.*?)?<\/a>/", $d, $matches ); $stripped .= $matches[1][0]."\n"; $stripped .= strip_tags($d); } $trimmed = explode("\n",$stripped); $final = array(); $nextkey = 1; $i=0; foreach($trimmed as $t) { $t = trim($t); if (!empty($t)) { if ($i == 0) { $param = "url"; } if ($i == 1) { $param = "title"; } if ($i == 2) { $param = "description"; } if ($i == 3) { $param = "version"; $t = eregi_replace("Version ","",$t); } if ($i == 4) { $param = "updated"; $t = eregi_replace("updated ","",$t); } if ($i == 5) { $param = "downloads"; $t = eregi_replace("downloads ","",$t); $t = eregi_replace(",","",$t); } if (eregi("Rating",$t)) { $final[] = $plugin; $i=0; } else { $plugin[$param] = $t; $i++; } } } // end parser update_option("dprx_pldl_cache",$final); update_option("dprx_pldl_cache_timestamp",time()); // for editing the parser code /* echo "
";
	print_r($final);
	echo "
"; */ } add_action('init', 'dprx_pldl_do',99); function dprx_pldl_do() { if (!empty($_GET['dprx_pldldo_ajax'])) { dprx_pldl_parser(); dprx_pldl_display_cache(); exit; } } function dprx_pldl_manage_page() { ?>

.

. : The Template Tag <? dprx_pldl_display_sum(); ?> :