📄 tag.func.php
字号:
$r['linkurl'] = linkurl($r['linkurl']);
$r['stitle'] = style(str_cut($r['title'], $titlelen , '...'), $r['style']);
$r['introduce'] = $introducelen ? str_cut(strip_tags($r['introduce']), $introducelen , '...') : '';
if($showcatname)
{
$r['catname'] = $CATEGORY[$r['catid']]['catname'];
$r['catlinkurl'] = linkurl($CATEGORY[$r['catid']]['linkurl']);
}
$products[] = $r;
}
$db->free_result($result);
if($temp_id) $TEMP['tag'][$temp_id] = $products;
}
if($target) $target = ' target="_blank"';
$width = ceil(100/$cols).'%';
if(!$templateid) $templateid = 'tag_product_list';
include template('yp', $templateid);
}
function yp_product_thumb($templateid = '', $catid = 0, $child = 1, $page = 0, $number = 10,$titlelen = 20, $introducelen = 0, $posid = 0, $datenum = 0, $ordertype = 0, $datetype = 0, $showalt = 0, $target = 0, $imgwidth = 100, $imgheight = 100, $cols = 1, $username = '', $elite = 0)
{
global $db, $PHP_TIME, $CONFIG, $CATEGORY, $TEMP, $categroy, $skindir;
$temp_id = 0;
if($page == 0 && defined('CREATEHTML'))
{
$temp_id = $templateid.$catid.$child.$page.$number.$titlelen.$introducelen.$posid.$datenum.$ordertype.$datetype.$showalt.$target.$imgwidth.$imgheight.$cols.$username.$elite;
}
if($temp_id && isset($TEMP['tag'][$temp_id]))
{
$products = $TEMP['tag'][$temp_id];
}
else
{
$datetypes = array('', 'Y-m-d', 'm-d', 'Y/m/d', 'Y.m.d', 'Y-m-d H:i:s', 'Y-m-d H:i');
$ordertypes = array('listorder DESC, productid DESC', 'edittime DESC', 'edittime ASC', 'hits DESC', 'hits ASC');
$page = isset($page) ? intval($page) : 1;
$status = $elite ? "status=5 " : "status>=3 ";
if($datetype < 0 || $datetype > 6) $datetype = 0;
if($ordertype < 0 || $ordertype > 4) $ordertype = 0;
$listpages = 0;
$condition = '';
if($catid)
{
if(is_numeric($catid))
{
if($child && $CATEGORY[$catid]['child'] && $CATEGORY[$catid]['arrchildid'])
{
$condition .= ' AND catid IN ('.$CATEGORY[$catid]['arrchildid'].') ';
}
else
{
$condition .= " AND catid=$catid ";
$listpages = 1;
}
}
else
{
$condition .= " AND catid IN ($catid) ";
}
}
if($datenum) $condition .= " AND addtime>$PHP_TIME-86400*$datenum ";
if($username) $condition .= " AND username='$username' ";
$offset = $page ? ($page-1)*$number : 0;
if($page && $number)
{
$r = $db->get_one("SELECT count(*) AS number FROM ".TABLE_YP_PRODUCT." WHERE $status $condition ");
if($categroy)
{
$pages = companypages(0, $r['number'], $page,$number);
}
else
{
$pages = $listpages ? listpages($catid, $r['number'], $page, $number) : phppages($r['number'], $page, $number);
}
}
$ordertype = $ordertypes[$ordertype];
$limit = $number ? " LIMIT $offset, $number " : 'LIMIT 0, 10';
$products = array();
$result = $db->query("SELECT SQL_CACHE * FROM ".TABLE_YP_PRODUCT." WHERE $status AND thumb!='' $condition ORDER BY $ordertype $limit ");
while($r = $db->fetch_array($result))
{
$r['adddate'] = $datetype ? date($datetypes[$datetype],$r['addtime']) : '';
$r['linkurl'] = linkurl($r['linkurl']);
$r['stitle'] = style(str_cut($r['title'], $titlelen , '...'), $r['style']);
$r['introduce'] = $introducelen ? str_cut(strip_tags($r['introduce']), $introducelen , '...') : '';
$r['thumb'] = imgurl($r['thumb']);
if($showalt) $r['alt'] = $r['title'];
$products[] = $r;
}
$db->free_result($result);
if($temp_id) $TEMP['tag'][$temp_id] = $products;
}
if($target) $target = ' target="_blank"';
$width = ceil(100/$cols).'%';
if(!$templateid) $templateid = 'tag_product_thumb';
include template('yp',$templateid);
}
function yp_product_slide($templateid = '', $catid = 0, $child = 1, $number = 5, $titlelen = 30, $posid = 0, $datenum = 0, $ordertype = 0, $imgwidth = 200, $imgheight = 180, $timeout = 5, $effectid = -1, $username = '', $elite = 0)
{
global $db, $PHP_TIME, $CONFIG, $CATEGORY, $skindir;
$ordertypes = array('listorder DESC, productid DESC', 'edittime DESC', 'edittime ASC', 'hits DESC', 'hits ASC');
if($number > 6) $number = 6;
if($ordertype < 0 || $ordertype > 4) $ordertype = 0;
$status = $elite ? "status=5 " : "status>=3 ";
$listpages = 0;
$condition = '';
if($catid)
{
if(is_numeric($catid))
{
if($child && $CATEGORY[$catid]['child'] && $CATEGORY[$catid]['arrchildid'])
{
$condition .= ' AND catid IN ('.$CATEGORY[$catid]['arrchildid'].') ';
}
else
{
$condition .= " AND catid=$catid ";
}
}
else
{
$condition .= " AND catid IN ($catid) ";
}
}
if($datenum) $condition .= " AND addtime>$PHP_TIME-86400*$datenum ";
if($username) $condition .= " AND username='$username' ";
$ordertype = $ordertypes[$ordertype];
$limit = $number ? " LIMIT 0, $number " : 'LIMIT 0, 5';
$k = 0;
$flash_pics = '';
$flash_links = '';
$flash_texts = '';
$products = array();
$result = $db->query("SELECT SQL_CACHE * FROM ".TABLE_YP_PRODUCT." WHERE $status AND thumb!='' $condition ORDER BY $ordertype $limit ");
while($r = $db->fetch_array($result))
{
$r['linkurl'] = linkurl($r['linkurl']);
$r['title'] = addslashes(str_cut($r['title'], $titlelen, '...'));
$r['thumb'] = imgurl($r['thumb']);
$s = $k ? '|' : '';
$flash_pics .= $s.$r['thumb'];
$flash_links .= $s.$r['linkurl'];
$flash_texts .= $s.$r['title'];
$k = 1;
$products[] = $r;
}
$db->free_result($result);
if(empty($products))
{
$products[0]['thumb'] = $flash_pics = PHPCMS_PATH.'images/nopic.gif';
$products[0]['linkurl'] = $flash_links = '#';
$products[0]['title'] = $flash_texts = 'No Picture';
}
$timeout = $timeout*1000;
if(!$templateid) $templateid = 'tag_product_slide';
include template('yp', $templateid);
}
function yp_job_list($templateid = '', $station = 0, $page = 0, $jobnum = 10, $titlelen = 30, $introducelen = 0, $posid = 0, $datenum = 0, $ordertype = 0, $datetype = 0, $showstationname = 0, $showauthor = 0, $showhits = 0, $target = 0, $cols = 1, $username = '', $elite = 0)
{
global $db, $PHP_TIME, $CONFIG, $CHA, $CATEGORY, $MODULE,$categroy, $skindir;
$datetypes = array('', 'Y-m-d', 'm-d', 'Y/m/d', 'Y.m.d', 'Y-m-d H:i:s', 'Y-m-d H:i');
$ordertypes = array('listorder DESC, jobid DESC', 'edittime DESC', 'edittime ASC', 'hits DESC', 'hits ASC');
$page = isset($page) ? intval($page) : 1;
$AREA = cache_read('areas_yp.php');
if($datetype < 0 || $datetype > 6) $datetype = 0;
if($ordertype < 0 || $ordertype > 4) $ordertype = 0;
$listpages = 0;
$status = $elite ? "status=5 " : "status>=3";
$condition = '';
if($station) $condition .= " AND station='$station' ";
if($posid)
{
$jobids = @file_get_contents(PHPCMS_ROOT.'/'.$mod.'/pos/'.$posid.'.txt');
if($jobids) $condition .= " AND jobid IN($jobids)";
}
if($datenum) $condition .= " AND addtime>$PHP_TIME-86400*$datenum ";
if($username) $condition .= " AND username='$username' ";
$offset = $page ? ($page-1)*$jobnum : 0;
if($page && $jobnum)
{
$r = $db->get_one("SELECT SQL_CACHE count(*) AS number FROM ".TABLE_YP_JOB." WHERE $status $condition ");
if($categroy)
{
$pages = companypages(3, $r['number'], $page,$jobnum);
}
else
{
$pages = phppages($r['number'], $page, $jobnum);
}
}
$ordertype = $ordertypes[$ordertype];
$limit = $jobnum ? " LIMIT $offset, $jobnum " : 'LIMIT 0, 10';
$jobs = array();
$result = $db->query("SELECT SQL_CACHE * FROM ".TABLE_YP_JOB." WHERE $status $condition ORDER BY $ordertype $limit ");
while($r = $db->fetch_array($result))
{
extract($db->get_one("SELECT companyname,linkurl FROM ".TABLE_MEMBER_COMPANY." WHERE companyid=$r[companyid]"));
$r['companyname'] = $companyname;
$r['url'] = $linkurl;
$r['adddate'] = $datetype ? date($datetypes[$datetype],$r['addtime']) : '';
$r['linkurl'] = linkurl($r['linkurl']);
$r['stitle'] = style(str_cut($r['title'], $titlelen , '...'), $r['style']);
$r['introduce'] = $introducelen ? str_cut(strip_tags($r['introduce']), $introducelen , '...') : '';
$r['province'] = $AREA[$r['areaid']]['areaname'];
$jobs[] = $r;
}
$db->free_result($result);
if($target) $target = ' target="_blank"';
$width = ceil(100/$cols).'%';
if(!$templateid) $templateid = 'tag_job_list';
include template('yp', $templateid);
}
function yp_apply_list($templateid = '', $station = 0, $page = 0, $applynum = 10, $posid = 0, $datenum = 0, $ordertype = 0, $datetype = 0, $showexperience = 0,$showschool = 0, $showspecialty = 0, $showhits = 0, $target = 0, $cols = 1, $elite = 0)
{
global $db, $PHP_TIME, $CONFIG, $CHA, $CATEGORY, $MODULE, $skindir;
$datetypes = array('', 'Y-m-d', 'm-d', 'Y/m/d', 'Y.m.d', 'Y-m-d H:i:s', 'Y-m-d H:i');
$ordertypes = array('listorder DESC, applyid DESC', 'edittime DESC', 'edittime ASC', 'hits DESC', 'hits ASC');
$page = isset($page) ? intval($page) : 1;
if($datetype < 0 || $datetype > 6) $datetype = 0;
if($ordertype < 0 || $ordertype > 4) $ordertype = 0;
$listpages = 0;
$status = $elite ? "status=5 " : "status>=3";
$condition = '';
if($station) $condition .= " AND station='$station' ";
if($posid)
{
$applyids = @file_get_contents(PHPCMS_ROOT.'/'.$mod.'/pos/'.$posid.'.txt');
if($applyids) $condition .= " AND applyid IN($applyids)";
}
if($datenum) $condition .= " AND addtime>$PHP_TIME-86400*$datenum ";
$offset = $page ? ($page-1)*$applynum : 0;
if($page && $applynum)
{
$r = $db->get_one("SELECT SQL_CACHE count(*) AS number FROM ".TABLE_YP_APPLY." WHERE $status $condition ");
$pages = phppages($r['number'], $page, $applynum);
}
$ordertype = $ordertypes[$ordertype];
$limit = $applynum ? " LIMIT $offset, $applynum " : 'LIMIT 0, 10';
$applys = array();
$result = $db->query("SELECT SQL_CACHE * FROM ".TABLE_YP_APPLY." WHERE $status $condition ORDER BY $ordertype $limit ");
while($r = $db->fetch_array($result))
{
@extract($db->get_one("SELECT i.gender FROM ".TABLE_MEMBER." m, ".TABLE_MEMBER_INFO." i WHERE m.username='$r[username]' AND m.userid=i.userid"));
$r['gender'] = $gender;
$r['adddate'] = $datetype ? date($datetypes[$datetype],$r['addtime']) : '';
$r['linkurl'] = linkurl($r['linkurl']);
$applys[] = $r;
}
$db->free_result($result);
if($target) $target = ' target="_blank"';
$width = ceil(100/$cols).'%';
if(!$templateid) $templateid = 'tag_apply_list';
include template('yp', $templateid);
}
function yp_company_list($templateid = '',$tradeid = 0, $child = 0, $page = 0, $elite = 0, $vip = 0,$number = 10, $length = 0, $posid = 0, $datenum = 0, $ordertype = 0, $datetype = 0, $showcontact = 0, $showhits = 0, $target = 0, $cols = 1,$pattern = 0)
{
global $db, $PHP_TIME, $CONFIG, $CHA, $MODULE, $TEMP,$MOD, $skindir;
$TRADE = cache_read('trades_trade.php');
$AREA = cache_read('areas_yp.php');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -