Demo: http://luxabu.com (Chọn ProSearch sau đó tìm kiếm...)
1. Mở file index.php
tìm
thêm vào dướielseif ($value[0] == 'Gift')
include('gift_receive.php')
Tìm tiếpelseif (in_array($value[0],array('Zplay','Zget')))
include('zing.php');
Thay bằngif (($value[0] != 'Download') && $_GET['url']) exit();
tìm tiếpif (($value[0] != 'Download') && ($value[0] != 'Zdownload') && $_GET['url']) exit();
Thêm vào bên trênif (($value[0] == 'Download') && is_numeric($value[1]) && $value[2]) {
2. Mở file includes/function.phpif(($value[0] == 'Zdownload') && $value[1]!='') {
$url_play = '/popupsong.php?zing='.$value[1];
$get_url = get_url($url_play);
$url_download = explode('<a href="/download?', $get_url);
$url_download = explode('" ', $url_download[1]);
$url = "http://mp3.zing.vn/download?".$url_download[0];
header("Location: ".$url);
exit();
}
Kéo xuống dưới cùng, Thêm hàm này vào
3. Mở file js/media.jsfunction get_url($string,$pages){
$string = str_replace(' ','+',$string);
if ($pages)
$string = '/mp3/search/do.'.$pages.'.html?q='.strtolower(utf8_to_ascii($s tring));
$fp = fsockopen("mp3.zing.vn",80, $errno, $errstr, 60);
if (!$fp)
return;
else
{
fputs ($fp, "GET ".$string." HTTP/1.0\r\n");
fputs ($fp, "Host: mp3.zing.vn\r\n");
fputs ($fp, "User-Agent: Mozilla 4.0\r\n\r\n");
$d = '';
while (!feof($fp))
$d .= fgets ($fp,2048);
fclose ($fp);
return $d;
}
}
Tìm
Thêm vào dướicase 'album' : type = 3; break;
Tìmcase 'internet' : type = 4; break;
Thêm vào trênwindow.location.href = '#Search,'+type+','+kw;
4. Mở file main.htmlif (type==4)
window.location.href = '#Zget,'+kw;
else
tìm
Thêm vào dưới<option value="album">Album</option>
5. Down file đính kèm...<option value="internet" style="color:red">Internet</option>
P/S: FIX lỗi chuỷên Trang cho code duhochanquoc và LuXaBu...
1. Mở functions.php
Thêm functions:
2. Mở zing.phpfunction m_searchviewpages($ttrow,$n,$pg){
global $value, $tpl;
$total = ceil($ttrow/$n);
if ($total <= 1) return '';
$v_f = 3;
$v_a = 2;
$v_l = 3;
$max_pages = $v_f + $v_a + $v_l + 5;
$z_1 = $z_2 = $z_3 = false;
if (in_array($value[0],array('Top_Download','Top_Play','Home','Ebooks',' Files'))) {
$link = '#'.$value[0];
$pg = ($value[1])?$value[1]:1;
}
elseif ($value[0] == 'Search' || $value[0] == 'Quick_Search') {
$link = '#'.$value[0].'/'.$value[1].'/'.$value[2];
}
elseif (in_array($value[0],array('List_Album','List_User'))) {
$link = '#'.$value[0];
}
else
$link = '#'.$value[0].'/'.$value[1];
$html = $tpl->get_box('view_pages');
$block = $tpl->get_block_from_str($html,'page_block');
$t = $tpl->auto_get_block($block);
$block = '';
$pgt = $pg-1;
if ($pg != 1)
$block .= $tpl->assign_vars($t['first_previous_page'],
array(
'page.L_LINK' => $link."/".$total,
'page.N_LINK' => $link."/".$pgs,
)
);
for($m = 1; $m <= $total; $m++) {
if ($total > $max_pages) {
if (($m > $v_f) && (($m < $pg - $v_a) || ($m > $pg + $v_a)) && ($m < $total - $v_l + 1)) {
if (!$z_1 && ($m > $v_f)) {
$block .= "...";
$z_1 = true;
}
elseif (!$z_2 && ($m > $pg + $v_a)) {
$block .= "...";
$z_2 = true;
}
continue;
}
}
if($m == $pg)
$block .= $tpl->assign_vars($t['current_page'],
array(
'page.NUMBER' => $m,
)
);
else
$block .= $tpl->assign_vars($t['page_number'],
array(
'page.NUMBER' => $m,
'page.LINK' => $link."/".$m,
)
);
}
$pgs = $pg + 1;
if ($pg != $total)
$block .= $tpl->assign_vars($t['last_next_page'],
array(
'page.L_LINK' => $link."/".$total,
'page.N_LINK' => $link."/".$pgs,
)
);
$html = $tpl->assign_blocks_content($html,
array(
'page_block' => $block,
)
);
return $html;
}
Tìm:
Sữa lại thànhm_viewpages
ưu ý là sữa lun những dấu , thành / . Chắc cái này ai cũng bik. Khỏi nói nữa hen...m_searchviewpages
Ai hack mod Youtube thì làm tương tự để chuỷên trang...
vietpro2008 (18-12-2009)












Trả Lời Với Trích Dẫn
