function smarty_function_htmlwarrior_init($params, &$smarty)
{
    global $htmlwarrior, $smarty;
    $path_code = $htmlwarrior->config['path_code'];
    $output = '';
    if ($htmlwarrior->config['live'] || $htmlwarrior->config['devmode']) {
        if ($params['position'] == 'top') {
            $bu = $htmlwarrior->config['baseurl'] . '/';
            $output = '<base href="' . $bu . '" />' . "\n";
        }
    }
    if ($htmlwarrior->config['live'] || !$htmlwarrior->config['devmode']) {
        $output .= '__htmlwarrior_remove_line__';
        return $output;
    }
    if (!isset($params['position'])) {
        $params['position'] = 'top';
    }
    if ($params['position'] == 'top') {
        $output .= html_javascript($path_code . '/admin/scripts/htmlwarrior_site_helpers', false) . "\n";
        $output .= html_javascript($path_code . '/admin/scripts/htmlwarrior_site_init.php', false) . "\n";
        $output .= '<link rel="stylesheet" type="text/css" href="' . $path_code . '/admin/style/_style_site.css" media="all" title="" />';
    } elseif ($params['position'] == 'bottom') {
        require_once 'includes/pagelist.php';
        require_once 'includes/imageoverlay.php';
        require_once 'includes/actionlist.php';
        $output .= pagelist($_GET['template_list_opened']);
        $output .= imageoverlay();
        $output .= actionlist();
        // load our scripts at the very end so we have overview of the page
        $output .= html_javascript($path_code . '/admin/scripts/externals/jquery', false) . "\n";
        $output .= html_javascript($path_code . '/admin/scripts/externals/jquery-ui', false) . "\n";
        $output .= html_javascript($path_code . '/admin/scripts/externals/jquery.cookie', false) . "\n";
        $output .= html_javascript($path_code . '/admin/scripts/htmlwarrior_site', false) . "\n";
    }
    $a_output = explode("\n", $output);
    $first_line = true;
    foreach ($a_output as $key => $var) {
        if (!$first_line) {
            $a_output[$key] = $params['indent'] . $var;
        } else {
            $first_line = false;
            $a_output[$key] = $var;
        }
    }
    // fix: remove lines with only spaces
    $a_outputFinal = array();
    foreach ($a_output as $key => $var) {
        if (trim($var) != '') {
            $a_outputFinal[$key] = $var;
        }
    }
    return implode("\n", $a_outputFinal);
}
function smarty_function_smartysh_init($params, &$smarty)
{
    global $smartysh, $smarty, $debug;
    if ($smartysh->config["live"]) {
        return "__smartysh_remove_line__";
    }
    if (!isset($params["position"])) {
        $params["position"] = "top";
    }
    $output = "";
    if ($params["position"] == "top") {
        $output .= html_javascript("../.." . $smartysh->config["path_code"] . "/scripts/smartysh_helpers") . "\n";
        $output .= html_javascript("../.." . $smartysh->config["path_code"] . "/scripts/smartysh_init.php") . "\n";
        $output .= '<link rel="stylesheet" type="text/css" href="' . $smartysh->config["path_code"] . '/admin/style/_style_site.css" media="screen, projection, print" title="" />';
    } elseif ($params["position"] == "bottom") {
        require_once "includes/pagelist.php";
        require_once "includes/actionlist.php";
        $output .= pagelist($_GET["template_list_opened"]);
        $output .= actionlist();
        // load our scripts at the very end so we have overview of the page
        $output .= html_javascript("../.." . $smartysh->config["path_code"] . "/admin/scripts/externals/jquery") . "\n";
        $output .= html_javascript("../.." . $smartysh->config["path_code"] . "/admin/scripts/externals/jquery-ui") . "\n";
        $output .= html_javascript("../.." . $smartysh->config["path_code"] . "/admin/scripts/externals/jquery.cookie") . "\n";
        $output .= html_javascript("../.." . $smartysh->config["path_code"] . "/scripts/psdOverlay") . "\n";
    }
    $a_output = explode("\n", $output);
    $first_line = true;
    foreach ($a_output as $key => $var) {
        if (!$first_line) {
            $a_output[$key] = $params["indent"] . $var;
        } else {
            $first_line = false;
            $a_output[$key] = $var;
        }
    }
    // fix: remove lines with only spaces
    $a_outputFinal = array();
    foreach ($a_output as $key => $var) {
        if (trim($var) != "") {
            $a_outputFinal[$key] = $var;
        }
    }
    return implode("\n", $a_outputFinal);
}
示例#3
0
images/star<?php 
        echo $r['rindex'];
        ?>
.gif"></soan></p>
                                </div>
                            </li>
                        
<?php 
    }
}
?>

                </ul>
            </div>
            <div class="p"><?php 
echo pagelist($total, $pagesize, $page, "");
?>
</div>
        </div>
    </div>
    <div class="clear">
    </div>

    
<?php 
include template('footer');
?>

</form>
</body>
</html>
示例#4
0
function filelist($phpvars, $page)
{
    global $FilesPerPage, $TimeZoneCorrection;
    $cnt = count($phpvars['files']);
    $pagecount = pagecount($cnt, $FilesPerPage);
    if ($page > $pagecount) {
        $page = $pagecount;
    }
    if ($page < 1) {
        $page = 1;
    }
    echo '<div class = "block"><center>Files for downloading</center><br>';
    echo '<table width="100%">';
    echo '<tr><td colspan="7"></td><td>name</td><td width="50" align="right">age</td><td width="60" align="right">total</td></tr>';
    foreach (array_slice($phpvars['files'], ($page - 1) * $FilesPerPage, $FilesPerPage) as $cur_queued) {
        $paused = $cur_queued['Paused'];
        if ($paused) {
            echo '<tr class="pausedgroup">';
        } else {
            echo '<tr class="unpausedgroup">';
        }
        echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=filedelete&offset=0&id=' . $cur_queued['ID'] . '\')"><IMG src=images/cancel.gif width=15 height=15 alt="remove file" title="remove file"></a></td>';
        echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=filemovetop&offset=0&id=' . $cur_queued['ID'] . '\')"><IMG src=images/first.gif width=15 height=15 alt="move file to top in queue" title="move file to top in queue"></a></td>';
        echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=filemoveoffset&offset=-1&id=' . $cur_queued['ID'] . '\')"><IMG src=images/up.gif width=15 height=15 alt="move file up" title="move file up"></a></td>';
        echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=filemoveoffset&offset=1&id=' . $cur_queued['ID'] . '\')"><IMG src=images/down.gif width=15 height=15 alt="move file down" title="move file down"></a></td>';
        echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=filemovebottom&offset=0&id=' . $cur_queued['ID'] . '\')"><IMG src=images/last.gif width=15 height=15 alt="move file to bottom in queue" title="move file to bottom in queue"></a></td>';
        echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=filepause&offset=0&id=' . $cur_queued['ID'] . '\')"><IMG src=images/pause.gif width=15 height=15 alt="pause file" title="pause file"></a></td>';
        echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=fileresume&offset=0&id=' . $cur_queued['ID'] . '\')"><IMG src=images/resume.gif width=15 height=15 alt="resume file" title="resume file"></a></td>';
        echo "<td>" . namereplace($cur_queued['NZBNicename']) . "/" . namereplace($cur_queued['Filename']) . "</td>";
        echo '<td align="right">' . formatAge($cur_queued['PostTime'] + $TimeZoneCorrection * 60 * 60) . '</td>';
        echo "<td align=right>" . round1($cur_queued['FileSizeLo'] / 1024 / 1024) . " MB</td>";
        echo '</tr>';
    }
    echo '</table>';
    if ($cnt > $FilesPerPage) {
        pagelist($cnt, $page, $FilesPerPage, 'page');
    }
    echo '</div>';
}
" target="_blank"><?php 
        echo $r['title'];
        ?>
</a></h1>
          <p><?php 
        echo $r['about'];
        ?>
</p>
          <span><a href="<?php 
        echo url("special.php?action=view&sid={$r['sid']}");
        ?>
" target="_blank">查看详情&gt;&gt;</a></span> </dd>
      </dl>
<?php 
    }
}
?>
  

  
      <div style="clear: both"> &nbsp; </div>
    </div>
<div>  <? echo pagelist($total,$pagesize,$page,"");; ?> </div>
  </div>
  <?php 
include template('footer');
?>
</form>
</body>
</html>
示例#6
0
文件: mini.php 项目: hank/nzbgetweb
function history($phpvars, $page)
{
    global $HistoryPerPage, $NewHistoryFirst, $HistoryTimeFormat, $TimeZoneCorrection;
    $cnt = count($phpvars['history']);
    $pagecount = pagecount($cnt, $HistoryPerPage);
    if ($page > $pagecount) {
        $page = $pagecount;
    }
    if ($page < 1) {
        $page = 1;
    }
    $history = $phpvars['history'];
    if (!$NewHistoryFirst) {
        $history = array_reverse($history);
    }
    echo '<div class = "block"><center>History</center><br>';
    echo '<table width="100%">';
    echo '<tr><td></td><td colspan="3">name</td><td>category</td></tr>';
    echo '<tr><td></td><td width="60" align="right">size</td><td width="40" align="right">files&nbsp;&nbsp;</td><td width="80">Par Status</td><td width="80">Script Status</td></tr>';
    foreach ($history as $hist) {
        echo '<tr><td colspan="8" width="100%"><table class="tableline" width="100%"><tr><td></td></tr></table></td></tr>';
        echo '<tr>';
        echo '<td width="10"><a href="?action=historydelete&offset=0&id=' . $hist['NZBID'] . '"><IMG src="images/cancel.gif" width="15" height="15" alt="remove from history" title="remove from history"></a></td>';
        echo '<td colspan="4" valign="top" class="date">' . date($HistoryTimeFormat, $hist['HistoryTime'] + $TimeZoneCorrection * 60 * 60) . '</td>';
        echo '<td valign="top"><span class="category">' . $hist['Category'] . '</span></td>';
        echo '</tr>';
        echo '<tr>';
        echo '<td width="10"></td>';
        echo '<td colspan="4" valign="top">' . $hist['NZBNicename'] . '</td>';
        echo '</tr>';
        echo '<tr>';
        echo '<td width="10"></td>';
        echo '<td valign="top" align="right">' . formatSizeMB($hist['FileSizeMB']) . '</td>';
        echo '<td valign="top" align="right">' . $hist['FileCount'] . '&nbsp;&nbsp;</td>';
        echo '<td valign="top"><span class="' . $hist['ParStatus'] . '">' . $hist['ParStatus'] . '</span></td>';
        echo '<td valign="top"><span class="' . $hist['ScriptStatus'] . '">' . $hist['ScriptStatus'] . '</span></td>';
        echo "</tr>";
    }
    echo '</table>';
    if ($cnt > $HistoryPerPage) {
        pagelist($cnt, $page, $HistoryPerPage, 'page');
    } else {
        echo '<br>';
    }
    echo '</div><br>';
}
示例#7
0
}
$pg_out = "";
$pg_out .= "<div align='center'> Page:";
$pg_out .= pagelist($pagenum, $pagelimit, $ttl_imgs);
$pg_out .= "</div>\n";
$pg_out .= "<div align='center'><table border='1' cellspacing='10' cellpadding='10' bordercolor='#666666' bordercolordark='#FFFFFF'>\n";
$ln = 1;
for ($l = $pg_st; $l < $pg_ed; $l++) {
    if ($ln == '1') {
        $pg_out .= "<tr><td align='center'><img src='" . $url . $mylist[$l] . "' width='125' height='193' border='0'><br>";
        $pg_out .= "<div id='foot'>" . $url . $mylist[$l] . "</div></td>\n";
        $ln = 0;
    } else {
        if ($ln == '2') {
            $pg_out .= "<td align='center'><img src='" . $url . $mylist[$l] . "' width='125' height='193' border='0'><br>";
            $pg_out .= "<div id='foot'>" . $url . $mylist[$l] . "</div></td>\n";
            $ln = 0;
        } else {
            $pg_out .= "<td align='center'><img src='" . $url . $mylist[$l] . "' width='125' height='193' border='0'><br>";
            $pg_out .= "<div id='foot'>" . $url . $mylist[$l] . "</div></td></tr>\n";
            $ln = 1;
        }
    }
}
$pg_out .= "</table></div>\n";
$pg_out .= "<div align='center'> Page:";
$pg_out .= pagelist($pagenum, $pagelimit, $ttl_imgs);
$pg_out .= "</div>\n";
$title = 'Character Images';
$output = $pg_out;
draw_page('charimg.php');
示例#8
0
 function get_list_tag($temp, $id, $cid, $p)
 {
     preg_match_all('/<luocms([\\s\\S]*?)>([\\s\\S]*?)<\\/luocms>/', $temp, $list_tag);
     $list_tagmax = count($list_tag[0]);
     //echo $list_tagmax;
     for ($l = 0; $l < $list_tagmax; $l++) {
         $attr = $list_tag[1][$l];
         $code = $list_tag[0][$l];
         preg_match_all('/([A-Za-z]{3,})=([\'|\\"])(.*?)(\\2)/', $attr, $codelist);
         $tempcodeMax = count($codelist[0]);
         $l_src = 'content';
         $l_cid = '';
         $l_num = 10;
         $l_type = '';
         // 属性变量清空
         for ($j = 0; $j < $tempcodeMax; $j++) {
             $attrName = strtolower($codelist[1][$j]);
             // 属性名称
             $attrValue = strtolower($codelist[3][$j]);
             // 属性对应值
             switch ($attrName) {
                 // 属性赋值
                 case "src":
                     $l_src = $attrValue;
                     break;
                 case "cid":
                     $l_cid = $attrValue;
                     break;
                 case "fid":
                     $l_fid = $attrValue;
                     break;
                 case "num":
                     $l_num = $attrValue;
                     break;
                     // 需要判断是否有效数量,是才赋值
                 // 需要判断是否有效数量,是才赋值
                 case "type":
                     $l_type = $attrValue;
                     break;
                 case "iscommend":
                     $l_iscommend = $attrValue;
                     break;
             }
         }
         // 根据根据各属性的值生成相应的SQL语句
         $sql_limit = "LIMIT 0,{$l_num}";
         if ($l_type == 'list') {
             $l_num_start = ($p - 1) * $l_num;
             $sql_limit = "LIMIT {$l_num_start},{$l_num}";
         }
         $sql_order = "ORDER BY id desc";
         switch ($l_src) {
             case "class":
                 $sql_table = '{pre}class';
                 $sql_field = 'id,fid,son,sons,name,style,title_u,title_bold,title_em';
                 $sql_order = "ORDER BY id asc";
                 break;
             case "content":
                 $sql_table = '{pre}content';
                 $sql_field = 'id,title,content,style,cid,title_bold,title_em,title_u,state,picture,dateline,count';
                 break;
             case "booklist":
                 $sql_table = '{pre}booklist';
                 $sql_field = "id,name,email,content,replay,replaytime,state";
                 break;
             case "link":
                 $sql_table = '{pre}link';
                 $sql_field = 'id,name,url,content,addtime,state';
                 break;
             case "tags":
                 $sql_table = '';
                 $sql_field = '';
                 break;
         }
         //$sql="SELECT * FROM luo_$l_src";
         switch ($l_type) {
             case "picture":
                 $sql_where = "ispicture=1";
                 break;
             case "hot":
                 if (!empty($cid)) {
                     $sql_where = "cid in ({$cid})";
                 } else {
                     $sql_where = "";
                 }
                 $sql_order = "ORDER BY count desc";
                 break;
             case "top":
                 if (!empty($l_iscommend)) {
                     if (!empty($cid)) {
                         $sql_where = "iscommend={$l_iscommend} and cid in ({$cid})";
                     } else {
                         $sql_where = "iscommend={$l_iscommend}";
                     }
                 } else {
                     if (!empty($cid)) {
                         $sql_where = "iscommend = 2 or (iscommend = 1 and cid in ({$cid}))";
                     } else {
                         $sql_where = "iscommend > 0";
                     }
                 }
                 $sql_order = "ORDER BY iscommend desc,count desc,id desc";
                 break;
             case "list":
                 $sql_where = "";
                 $sql_order = "ORDER BY rank asc,id desc";
                 break;
             case "menu":
                 $sql_where = "rank>=0 and fid=0";
                 $sql_order = "ORDER BY id asc";
                 break;
             case "booklist":
                 $sql_where = "state=1";
                 break;
         }
         // cid 处理(and)
         //echo $id;
         if (strlen($l_fid) > 0) {
             if (strlen($sql_where) > 0) {
                 $sql_where = ' and ' . $sql_where;
             }
             $sql_where = 'fid in (' . $l_fid . ')' . $sql_where;
         }
         if (strlen($l_cid) > 0) {
             if (strlen($sql_where) > 0) {
                 $sql_where = ' and ' . $sql_where;
             }
             $sql_where = 'cid in (' . $l_cid . ')' . $sql_where;
         }
         if ($l_type == 'list') {
             if (strlen($sql_where) > 0) {
                 $sql_where = ' and ' . $sql_where;
             }
             if (isset($cid)) {
                 $sql_where = 'cid in (' . get_sons($GLOBALS[cid]) . ')' . $sql_where;
             }
         }
         if ($l_src == 'link') {
             if (strlen($sql_where) > 0) {
                 $sql_where = ' and ' . $sql_where;
             }
             $sql_where = 'state = 1' . $sql_where;
         }
         if ($l_src == 'booklist') {
             if (strlen($sql_where) > 0) {
                 $sql_where = ' and ' . $sql_where;
             }
             $sql_where = 'state = 1' . $sql_where;
         }
         // WHERE 关键字是否需要加上
         if (strlen($sql_where) > 0) {
             $sql_where = ' WHERE ' . $sql_where;
         }
         $sqlstr = $this->get_sql("SELECT {$sql_field} FROM {$sql_table} {$sql_where} {$sql_order} {$sql_limit}");
         //echo $sqlstr."<br>";
         $sql_field = "";
         $sql_table = "";
         $sql_where = "";
         $sql_order = "";
         $sql_limit = "";
         //替换数据
         $temp = str_replace($code, $this->getdata($sqlstr, $code), $temp);
         //替换分页标签
         $url = empty($cid) ? 'index' : $this->get_tpl_name($cid, 'template') . '-' . $cid;
         $cid_temp = empty($cid) ? '' : get_sons($cid);
         $var_pagelist = pagelist($cid_temp, $l_num, $url, $p);
         $temp = str_replace('{pagelist}', $var_pagelist, $temp);
         $var_gbook_pagelist = gbook_pagelist($cid_temp, $l_num, $url, $p);
         $temp = str_replace('{gbookpagelist}', $var_gbook_pagelist, $temp);
         //清空临时变量
         $l_src = "";
         $l_cid = "";
         $l_fid = "";
         $l_num = "";
         $l_type = "";
     }
     return $temp;
 }
示例#9
0
function list_tag($str, $id, $p, $row)
{
    preg_match_all('/{list(.*){\\/list}/isU', $str, $p_arr);
    foreach ($p_arr[0] as $k => $v) {
        $search = '';
        $search[] = $v;
        preg_match('/{list(.*)}(.*){\\/list}/isU', $v, $p_attr);
        preg_match_all('/{(.*)\\/}/isU', $p_attr[2], $list_attr);
        $list_attr = $list_attr[1];
        $rel_arr = pagelist($id, $p, $row);
        for ($i = 0; $i < count($rel_arr); $i++) {
            $search_rel = '';
            $replace_rel = '';
            foreach ($rel_arr[$i] as $a => $b) {
                if (in_array($a, $list_attr)) {
                    $search_rel[] = '{' . $a . '/}';
                    $replace_rel[] = $b;
                }
                $search_rel['url'] = '{url/}';
                $replace_rel['url'] = 'show.php?id=' . $rel_arr[$i]['id'];
            }
            $list .= str_replace($search_rel, $replace_rel, $p_attr[2]);
        }
        $str = str_replace($search, $list, $str);
        //$page_no=pages_tag($total_page);
        //$str=str_replace('{page/}',$page_no,$str);
    }
    return $str;
}