Files
2026-09-03 08:38:17 +08:00

2 lines
11 KiB
JSON

{"data_cache_newsforeach": "0", "data_cache_foreach": "678a208cf292f", "home_pagenum": "20", "source_sha256": "725a996c0383f38e7c051f0488e3928c3547404e89f91fb6d55c8610d0980367", "news_function_start_line": 1502, "source_excerpt": "1502: function gxl_mysql_news($tag)\n1503: {\n1504: \t$search = array();\n1505: \t$where = array();\n1506: \t$tag = gxl_param_lable($tag);\n1507: \t$field = (!empty($tag[\"field\"]) ? $tag[\"field\"] : \"*\");\n1508: \t$limit = (!empty($tag[\"limit\"]) ? $tag[\"limit\"] : \"10\");\n1509: \t$order = (!empty($tag[\"order\"]) ? $tag[\"order\"] : \"news_addtime\");\n1510: \tif (C(\"data_cache_newsforeach\") && (C(\"currentpage\") < 2)) {\n1511: \t\t$data_cache_name = md5(C(\"data_cache_foreach\") . implode(\",\", $tag));\n1512: \t\t$data_cache_content = S($data_cache_name);\n1513: \n1514: \t\tif ($data_cache_content) {\n1515: \t\t\treturn $data_cache_content;\n1516: \t\t}\n1517: \t}\n1518: \t$where[\"news_status\"] = array(\"eq\", 1);\n1519: \n1520: \tif ($tag[\"ids\"]) {\n1521: \t\t$where[\"news_id\"] = array(\"in\", $tag[\"ids\"]);\n1522: \t}\n1523: \n1524: \tif ($tag[\"day\"]) {\n1525: \t\t$where[\"news_addtime\"] = array(\"gt\", getxtime($tag[\"day\"]));\n1526: \t}\n1527: \n1528: \tif ($tag[\"hits\"]) {\n1529: \t\t$hits = explode(\",\", $tag[\"hits\"]);\n1530: \n1531: \t\tif (1 < count($hits)) {\n1532: \t\t\t$where[\"news_hits\"] = array(\"between\", $hits[0] . \",\" . $hits[1]);\n1533: \t\t}\n1534: \t\telse {\n1535: \t\t\t$where[\"news_hits\"] = array(\"gt\", $hits[0]);\n1536: \t\t}\n1537: \t}\n1538: \n1539: \tif ($tag[\"cid\"]) {\n1540: \t\t$cids = explode(\",\", trim($tag[\"cid\"]));\n1541: \n1542: \t\tif (1 < count($cids)) {\n1543: \t\t\t$where[\"news_cid\"] = array(\"in\", getlistarr_tag($cids));\n1544: \t\t}\n1545: \t\telse {\n1546: \t\t\t$where[\"news_cid\"] = getlistsqlin($tag[\"cid\"]);\n1547: \t\t}\n1548: \t}\n1549: \n1550: \tif ($tag[\"stars\"]) {\n1551: \t\t$where[\"news_stars\"] = array(\"in\", $tag[\"stars\"]);\n1552: \t}\n1553: \tif ($tag[\"pic\"]) {\n1554: \t\t$where[\"news_pic\"] = array(\"like\", \"%\" . $tag[\"pic\"] . \"%\");\n1555: \t}\n1556: \tif ($tag[\"letter\"]) {\n1557: \t\t$where[\"news_letter\"] = array(\"in\", $tag[\"letter\"]);\n1558: \t}\n1559: \n1560: \tif ($tag[\"name\"]) {\n1561: \t\t$where[\"news_name\"] = array(\"like\", \"%\" . $tag[\"name\"] . \"%\");\n1562: \t}\n1563: \n1564: \tif ($tag[\"title\"]) {\n1565: \t\t$where[\"news_title\"] = array(\"like\", \"%\" . $tag[\"title\"] . \"%\");\n1566: \t}\n1567: \n1568: \tif ($tag[\"no\"]) {\n1569: \t\t$where[\"news_id\"] = array(\"neq\", $tag[\"no\"]);\n1570: \t}\n1571: \n1572: \tif ($tag[\"wd\"]) {\n1573: \t\t$search[\"news_name\"] = array(\"like\", \"%\" . $tag[\"wd\"] . \"%\");\n1574: \t\t$search[\"news_inputer\"] = array(\"like\", \"%\" . $tag[\"wd\"] . \"%\");\n1575: \t\t$search[\"_logic\"] = \"or\";\n1576: \t\t$where[\"_complex\"] = $search;\n1577: \t}\n1578: \n1579: \tif ($tag[\"up\"]) {\n1580: \t\t$up = explode(\",\", $tag[\"up\"]);\n1581: \n1582: \t\tif (1 < count($up)) {\n1583: \t\t\t$where[\"news_up\"] = array(\"between\", $up[0] . \",\" . $up[1]);\n1584: \t\t}\n1585: \t\telse {\n1586: \t\t\t$where[\"news_up\"] = array(\"gt\", $up[0]);\n1587: \t\t}\n1588: \t}\n1589: \n1590: \tif ($tag[\"down\"]) {\n1591: \t\t$down = explode(\",\", $tag[\"down\"]);\n1592: \n1593: \t\tif (1 < count($down)) {\n1594: \t\t\t$where[\"news_down\"] = array(\"between\", $down[0] . \",\" . $down[1]);\n1595: \t\t}\n1596: \t\telse {\n1597: \t\t\t$where[\"news_down\"] = array(\"gt\", $down[0]);\n1598: \t\t}\n1599: \t}\n1600: \n1601: \tif ($tag[\"gold\"]) {\n1602: \t\t$gold = explode(\",\", $tag[\"gold\"]);\n1603: \n1604: \t\tif (1 < count($gold)) {\n1605: \t\t\t$where[\"news_gold\"] = array(\"between\", $gold[0] . \",\" . $gold[1]);\n1606: \t\t}\n1607: \t\telse {\n1608: \t\t\t$where[\"news_gold\"] = array(\"gt\", $gold[0]);\n1609: \t\t}\n1610: \t}\n1611: \n1612: \tif ($tag[\"golder\"]) {\n1613: \t\t$golder = explode(\",\", $tag[\"golder\"]);\n1614: \n1615: \t\tif (1 < count($golder)) {\n1616: \t\t\t$where[\"news_golder\"] = array(\"between\", $golder[0] . \",\" . $golder[1]);\n1617: \t\t}\n1618: \t\telse {\n1619: \t\t\t$where[\"news_golder\"] = array(\"gt\", $golder[0]);\n1620: \t\t}\n1621: \t}\n1622: \n1623: \n1624: \t if ($tag[\"tag\"]) {\n1625: \t\t$tagwhere[\"tag_sid\"] = $tag[\"sid\"]? $tag[\"sid\"]:2;\n1626: \t $tagwhere[\"tag_name\"] =urldecode($tag[\"tag\"]);\n1627: \t\t$rs = D('TagnewsView');\n1628: \t\tif(S('news_count'.$tagwhere[\"tag_name\"])){\n1629: \t $count = S('news_count'.$tagwhere[\"tag_name\"]);\n1630: \t }else{\n1631: \t\t $count = $rs->where($tagwhere)->count();\n1632: // \u7f13\u5b58\u6570\u636e300\u79d2\n1633: S('news_count'.$tagwhere[\"tag_name\"],$count,3000);\n1634: \t } \t\n1635: \t}\n1636: \telse if ($tag[\"news\"]) {\n1637: \t\tif ($tag[\"type\"]) {\n1638: \t\t\t$where[\"newsrel_sid\"] = $tag[\"type\"];\n1639: \t\t}\n1640: \n1641: \t\tif (!empty($tag[\"did\"])) {\n1642: \t\t\t$search[\"newsrel_did\"] = $tag[\"did\"];\n1643: \t\t\t$search[\"newsrel_name\"] = $tag[\"news\"];\n1644: \t\t\t$search[\"_logic\"] = \"or\";\n1645: \t\t\t$where[\"_complex\"] = $search;\n1646: \t\t}\n1647: \t\telse {\n1648: \t\t\t$where[\"newsrel_name\"] = $tag[\"news\"];\n1649: \t\t}\n1650: \n1651: \t\t$rs = D(\"StarnewsView\");\n1652: \t}\n1653: \telse {\n1654: \t\t$rs = M(\"News\");\n1655: \t\t if(S('news_count'.$where[\"news_cid\"])){\n1656: \t $count = S('news_count'.$where[\"news_cid\"]);\n1657: \t }else{\n1658: \t\t$count = $rs->where($where)->count(\"news_id\");\n1659: // \u7f13\u5b58\u6570\u636e300\u79d2\n1660: S('news_count'.$where[\"news_cid\"],$count,3000);\n1661: \t }\n1662: \t\t\n1663: \t}\n1664: \n1665: \t\t \n1666: \tif ($tag[\"page\"]) {\n1667: \t if (!$count) {\n1668: \t\t\treturn false;\n1669: \t\t}\n1670: \t \n1671: $home_pagenum=5;\n1672: \t\t$totalpages = ceil($count / $limit);\n1673: \t\t$currentpage = get_maxpage(C(\"currentpage\"), $totalpages);\n1674: \t\t$pageurl = urldecode(C(\"jumpurl\"));\n1675: \t\t$pages = getpage($currentpage, $totalpages,$home_pagenum, $pageurl, \"pagego('\" . $pageurl . \"',\" . $totalpages . \")\");\n1676: \t\t$pagestop = \"<strong>\" . $currentpage . \"/\" . $totalpages . \"</strong>\" . getpagetop($currentpage, $totalpages, $home_pagenum, $pageurl, \"pagego('\" . $pageurl . \"',\" . $totalpages . \")\");\n1677: \t\t$list = $rs->field($field)->where($where)->order($order)->limit($limit)->page($currentpage)->select();\n1678: \t\t\n1679: \t\tif ($tag[\"tag\"]) {\n1680: \t\t \n1681: \t\t $list = $rs->field($field)->where($tagwhere)->order($order)->limit($limit)->page($currentpage)->select(); \t\n1682: \t }else{\n1683: \t $list = $rs->field($field)->where($where)->order($order)->limit($limit)->page($currentpage)->select();\n1684: \t }\n1685: \t\t$list[0][\"count\"] = count($list);\n1686: \t\t$list[0][\"page\"] = $pages;\n1687: \t\t$list[0][\"pagecount\"] = $count;\n1688: \t\t$list[0][\"pagetop\"] = $pagestop;\n1689: \t}\n1690: \telse {\n1691: \t\t$list = $rs->field($field)->where($where)->order($order)->limit($limit)->select();\n1692: \t\tif ($tag[\"count\"] && empty($tag[\"page\"])) {\n1693: \t\t\t$count = $rs->where($where)->count(\"news_id\");\n1694: \n1695: \t\t\tif (!$count) {\n1696: \t\t\t\treturn false;\n1697: \t\t\t}\n1698: \n1699: \t\t\t$list[0][\"counts\"] = $count;\n1700: \t\t}\n1701: \t}\n1702: \n1703: \tforeach ($list as $key => $val ) {\n1704: \t\t$list[$key][\"list_id\"] = $list[$key][\"news_cid\"];\n1705: \t\t$list[$key][\"news_name\"] = htmlentities($val[\"news_name\"]);\n1706: \t\t$list[$key][\"news_remark\"] =$val[\"news_remark\"]?htmlentities($val[\"news_remark\"]):'';\n1707: \t\tif($val[\"news_content\"]){\n1708: \t\t$list[$key][\"news_content\"] =$val[\"news_content\"]?htmlentities($val[\"news_content\"]):'';\n1709: \t\t}\n1710: \t\t$list[$key][\"list_name\"] = getlistname($list[$key][\"list_id\"], \"list_name\");\n1711: \t\t$list[$key][\"list_url\"] = getlistname($list[$key][\"list_id\"], \"list_url\");\n1712: \t\t$list[$key][\"news_readurl\"] = gxl_data_url(\"news\", $list[$key][\"news_id\"], $list[$key][\"news_cid\"], $list[$key][\"news_name\"], 1, $list[$key][\"news_jumpurl\"]);\n1713: \t if($val[\"news_pic\"]){\n1714: \t\t$list[$key][\"news_picurl\"] = gxl_img_url($list[$key][\"news_pic\"], $list[$key][\"news_content\"]);\n1715: \t\t$list[$key][\"news_picurl_small\"] = gxl_img_url_small($list[$key][\"news_pic\"], $list[$key][\"news_content\"]);\n1716: \t }\n1717: \t}\n1718: \n1719: \tif (C(\"data_cache_newsforeach\") && (C(\"currentpage\") < 2)) {\n1720: \t\tS($data_cache_name, $list, intval(C(\"data_cache_newsforeach\")));\n1721: \t}\n1722: \n1723: \treturn $list;\n1724: }\n1725: \n1726: function gxl_mysql_icp($tag)\n1727: {\n1728: \n1729: \n1730: $search = array();\n1731: $where = array();\n1732: $tag = gxl_param_lable($tag);\n1733: $field = (!empty($tag[\"field\"]) ? $tag[\"field\"] : \"*\");\n1734: $limit = (!empty($tag[\"limit\"]) ? $tag[\"limit\"] : \"10\");\n1735: $order = (!empty($tag[\"order\"]) ? $tag[\"order\"] : \"icp_addtime\");\n1736: if (C(\"data_cache_icpforeach\") && (C(\"currentpage\") < 2)) {\n1737: $data_cache_name = md5(C(\"data_cache_foreach\") . implode(\",\", $tag));\n1738: $data_cache_content = S($data_cache_name);\n1739: \n1740: if ($data_cache_content) {\n1741: return $data_cache_content;\n1742: }\n1743: }\n1744: \n1745: \n1746: \n1747: \n1748: \n1749: $rs = M(\"icp\");\n1750: \n1751: ", "category": "list_id\tlist_pid\tlist_sid\tlist_dir\tlist_skin\n173\t0\t2\tapp_games\tgxl_newslist\n", "news_indexes": "Table\tNon_unique\tKey_name\tSeq_in_index\tColumn_name\tCollation\tCardinality\tSub_part\tPacked\tNull\tIndex_type\tComment\tIndex_comment\ngxl_news\t0\tPRIMARY\t1\tnews_id\tA\t65914\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnews_cid\t1\tnews_cid\tA\t1\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnews_up\t1\tnews_up\tA\t1\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnews_down\t1\tnews_down\tA\t1\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnews_gold\t1\tnews_gold\tA\t1\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnews_hits\t1\tnews_hits\tA\t329\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnews_hits\t2\tnews_cid\tA\t315\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnewslist\t1\tnews_status\tA\t1\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnewslist\t2\tnews_cid\tA\t1\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnewslist\t3\tnews_addtime\tA\t65914\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnews_cid_list\t1\tnews_status\tA\t1\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tnews_cid_list\t2\tnews_cid\tA\t1\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tso\t1\tnews_name\tA\t65914\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tso\t2\tnews_status\tA\t65914\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tidx_news_status_addtime\t1\tnews_status\tA\t1\tNULL\tNULL\t\tBTREE\t\t\ngxl_news\t1\tidx_news_status_addtime\t2\tnews_addtime\tA\t65914\tNULL\tNULL\t\tBTREE\t\t\n", "mysql_status": "Variable_name\tValue\nSlow_queries\t4392\nThreads_connected\t17\nThreads_running\t2\n"}