예제 #1
0
 public function searchitem()
 {
     //根据内容识别搜索类型
     //判断是否数字
     //如果是数字,搜索barcode
     //如果是字符串,搜索名称、品牌和功效
     $db = D($this->_table);
     $items;
     $page;
     $key = '%' . I('post.key', '', 'strip_tags') . '%';
     $map['name|cn_name'] = array('like', $key);
     $count = list_pages($db, $items, $page, $this->_shownum, $map);
     // =$db->where($map)->select();
     $this->assign("items", $items);
     $this->assign("page", $page);
     $this->display("Public/viewitems");
 }
예제 #2
0
파일: render.php 프로젝트: jemacom/mdsite
function list_pages($dir = ".")
{
    $list = array();
    foreach (scandir($dir) as $filename) {
        if ($filename == "." or $filename == "..") {
            continue;
        }
        $filepath = "{$dir}/{$filename}";
        if (is_file($filepath) and substr($filename, -3) == ".md") {
            // if it's a page, remove the ".md"
            $list[substr($filename, 0, -3)] = substr($filepath, 2, -3);
        } elseif (is_dir($filepath) and list_pages($filepath) != false) {
            // if it's a directory, recurse into it to return a nested array
            $list[$filename] = list_pages($filepath);
        }
    }
    return $list;
}
예제 #3
0
    $_configured = true;
} else {
    $_path = realpath($kernel_path . '/../') . '/';
    $_url = get_url();
    $_configured = false;
}
require_once $kernel_path . "/Database.php";
require_once $core_path . "/Constants.php";
require_once $core_path . "/db-mapping.php";
require_once $core_path . "/Requetes.php";
connect_db();
// verifie l'installation complete
$install_step = verif_install();
$installing = isInstalling();
// verifie si l'URL REWRITING est activée
$_rewrite = _mod_rewrite();
// info config
extract(load_config());
if (!$installing) {
    // load_plugin(); // => import de plug-in... non fonctionnel
    require_once $core_path . "/Functions.php";
    if (request_confirm('setMessageEditionMode')) {
        LanguageValidation::setMessageEditionMode();
    }
    if (LanguageValidation::isMessageEditionMode()) {
        translateForm::edition();
    }
    require_once $core_path . "/Refresh.php";
    require_once $core_path . "/Menu.php";
    $_menu_ = list_pages();
}
예제 #4
0
            $subtitle = stripslashes(check_html($row2['subtitle'], "nohtml"));
            $clanguage = $row2['clanguage'];
            if ($multilingual == 1) {
                $the_lang = "<img src=\"images/language/flag-" . $clanguage . ".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">";
            } else {
                $the_lang = "";
            }
            if ($subtitle != "") {
                $subtitle = " ({$subtitle}) ";
            } else {
                $subtitle = " ";
            }
            echo "<strong><big>&middot;</big></strong> {$the_lang} <a href=\"modules.php?name={$module_name}&amp;pa=showpage&amp;pid={$pid}\">{$title}</a> {$subtitle} [ <a href=\"admin.php?op=content_edit&amp;pid={$pid}\">" . _EDIT . "</a> | <a href=\"admin.php?op=content_change_status&amp;pid={$pid}&amp;active=0\">" . _ACTIVATE . "</a> | <a href=\"admin.php?op=content_delete&amp;pid={$pid}\">" . _DELETE . "</a> ]<br>";
        }
        echo "</blockquote>";
    }
    echo "<center>" . _GOBACK . "</center>";
    CloseTable();
    include "footer.php";
}
switch ($pa) {
    case "showpage":
        showpage($pid, $page);
        break;
    case "list_pages_categories":
        list_pages_categories($cid);
        break;
    default:
        list_pages();
        break;
}
예제 #5
0
    function list_pages($parent_id, $pages, $sub = '')
    {
        foreach ($pages[$parent_id] as $page) {
            ?>
            <tr>
                <td style="width:20px;"><?php 
            echo $page->parent_id == -1 ? '<i class="icon-eye-slash"></i>' : '';
            ?>
</td>
                <td><?php 
            echo $sub . $page->title;
            ?>
</td>
                <td class="text-right">
                    <div class="btn-group">
                        <?php 
            if (!empty($page->url)) {
                ?>
                            <a class="btn btn-default" href="<?php 
                echo site_url('admin/pages/link_form/' . $page->id);
                ?>
"><i class="icon-pencil"></i></a>
                            <a class="btn btn-default" href="<?php 
                echo $page->url;
                ?>
" target="_blank"><i class="icon-link"></i></a>
                        <?php 
            } else {
                ?>
                            <a class="btn btn-default" href="<?php 
                echo site_url('admin/pages/form/' . $page->id);
                ?>
"><i class="icon-pencil"></i></a>
                            <a class="btn btn-default" href="<?php 
                echo site_url('page/' . $page->slug);
                ?>
" target="_blank"><i class="icon-eye"></i></a>
                        <?php 
            }
            ?>
                        <a class="btn btn-danger" href="<?php 
            echo site_url('admin/pages/delete/' . $page->id);
            ?>
" onclick="return areyousure();"><i class="icon-times"></i></a>
                    </div>
                </td>
            </tr>
            <?php 
            if (isset($pages[$page->id]) && sizeof($pages[$page->id]) > 0) {
                $sub2 = str_replace('&rarr;&nbsp;', '&nbsp;', $sub);
                $sub2 .= '&nbsp;&nbsp;&nbsp;&rarr;&nbsp;';
                list_pages($page->id, $pages, $sub2);
            }
        }
    }
예제 #6
0
function nak_gp_setting_input()
{
    global $get_page;
    // get option 'text_string' value from the database
    $options = get_option('nak_gp_options');
    ?>
		
		
<div class="widget-liquid-left">
<div id="widgets-left">		
		
		<div class="postbox-container">
		
			<div class="metabox-holder">
			
				<div class="postbox" id="settings">
		
					<table class="form-table">
						<tr valign="top">
							<th scope="row">Username / Email</th>
							<td>
								<input type="text" name="nak_gp_options[username]" value="<?php 
    echo $options['username'];
    ?>
" />
						</tr>
						<tr>
							<th scope="row">Password</th>
							<td>
								<input type="password" name="nak_gp_options[password]" value="<?php 
    echo $options['password'];
    ?>
" />
						</tr>
						
						<tr>
							<th scope="row">Number of album results per page</th>
							<td>
								<input type="number" name="nak_gp_options[max_album_results]" value="<?php 
    echo $options['max_album_results'];
    ?>
" />
							</td>
						</tr>
						<tr>
							<th scope="row">Album thumbnail size (px)</th>
							<td>
								<input type="number" name="nak_gp_options[album_thumb_size]" value="<?php 
    echo $options['album_thumb_size'];
    ?>
" />
							</td>
						</tr>
						<tr>
							<th scope="row">Number of image results per page</th>
							<td>
								<input type="number" name="nak_gp_options[max_results]" value="<?php 
    echo $options['max_results'];
    ?>
" />
							</td>
						</tr>
						<tr>
							<th scope="row">Thumbnail size (px)</th>
							<td>
								<input type="number" name="nak_gp_options[thumb_size]" value="<?php 
    echo $options['thumb_size'];
    ?>
" />
							</td>
						</tr>
						<tr>
							<th scope="row">Lightbox image size (px)</th>
							<td>
								<input type="number" name="nak_gp_options[max_image_size]" value="<?php 
    echo $options['max_image_size'];
    ?>
" />
							</td>
						</tr>
						<tr>
							<th>Page to show album results on </th>
							<td>
							<select style="width:240px;" name="nak_gp_options[album_results_page]" id="">
							<?php 
    foreach (list_pages() as $key => $page) {
        ?>
<option value="<?php 
        echo $key;
        ?>
" <?php 
        if ($options['album_results_page'] == $key) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $page;
        ?>
</option>
							<?php 
    }
    ?>
							</select>
							<p>
								<small>This is the page to place the shortcode, [nak_google_picasa_album_images]</small>
							</p>
							</td>
						</tr>

						
						
					</table>
					
				</div>
				
				<input type="submit" name="submit" class="button-primary" value="<?php 
    _e('Save Changes');
    ?>
" />

			</div>
			
		</div>
		
		
</div>
</div>		
		
		
		
		<?php 
}
 public function searchitem()
 {
     //根据内容识别搜索类型
     //判断是否数字
     //如果是数字,搜索barcode
     //如果是字符串,搜索名称、品牌和功效
     $db = D('BestForBaby');
     $key = I('post.key', 0, 'intval');
     $items = array();
     $items;
     $page;
     if ($key != 0) {
         $items = $db->where("barcode = %d", $key)->select();
         $this->assign("items", $items);
     } else {
         $key = '%' . I('post.key', '', 'strip_tags') . '%';
         $map['name|barcode'] = array('like', $key);
         $count = list_pages($db, $items, $page, $this->_shownum, $map);
         // =$db->where($map)->select();
         $this->assign("items", $items);
     }
     $this->assign("page", $page);
     $this->display("search-result");
 }
예제 #8
0
		<th>' . $Template->e('author') . '</th>
		<th>' . $Template->e('type') . '</th>
		<th>' . $Template->e('edited') . '</th>
		<th>' . $Template->e('new') . '</th>
		<th>' . $Template->e('trash') . '</th>
	</tr>
';
/**
 * fetch the pages info from the db and list the pages 
 */
$pages = array();
$query = query('select id,name,type,edited,user,parent,home,perm from ' . DB_PAGES . ' order by position,name asc');
while ($row = mysql_fetch_assoc($query)) {
    $pages[$row['parent']][] = $row;
}
$content .= list_pages(0, $pages);
$content .= '
	<tr class="not-sortable">
		<th class="pages-table-left">
			<input type="checkbox" class="checkbox-all" all=""/>
		</th>
		<th colspan="6">&nbsp;</th>
	</tr>

</table>

<div style="float:right;margin-top:10px">
	<select name="action" class="trash-select select-p_2">
		<option default="default">---</option>
		<option value="Trash">' . $Template->e('trash') . '</option>
	</select> 
예제 #9
0
function list_pages($id, $pages, $level = 0)
{
    $User = User::getInstance();
    $num = 0;
    if (!isset($pages[$id])) {
        return;
    }
    $list = '';
    foreach ($pages[$id] as $page) {
        $perm = explode('|', $page['perm']);
        if ($User->adminPagePerm($perm[1])) {
            $num++;
            $parent = isset($pages[$page['id']]) ? ' parent' : '';
            $href = '<a href="pages.php?page=edit&id=' . $page['id'] . '" class="list-link">';
            $class = $level == 0 ? ' ' : ' child-of-node-' . $page['parent'] . '';
            $delete = $page['home'] == 1 ? '' : '<a id="' . $page['id'] . '" class="delete link"><span class="admin-menu-img" id="menu_trash-img" title="Delete Page" alt="Delete Page">&nbsp;</span></a>';
            $list .= '<tr id="node-' . $page['id'] . '" class="expanded odd ' . $class . $parent . '">
        	                	<td class="pages-table-left"><input type="checkbox" value="' . $page['id'] . '" name="trash-box"/></td>
                	                <td class="first">' . $href . $page['name'] . '</a></td>
                        	        <td>' . $href . $page['user'] . '</a></td>
	                                <td>' . $href . $page['type'] . '</a></td>
        	                        <td>' . $href . date("d/m/y", strtotime($page['edited'])) . '</a></td>
                	                <td><a href="pages.php?page=new&parent=' . $page['id'] . '"><span class="admin-menu-img" id="menu_new_page-img" title="New Sub Page" alt="New Sub Page">&nbsp;</span></a></td>
	                	        <td>' . $delete . '</td>
	                        </tr>';
        }
        $list .= list_pages($page['id'], $pages, $level + 1);
    }
    return $list;
}
예제 #10
0
 public function searchitem()
 {
     $db = D($this->_table);
     $items;
     $page;
     $key = '%' . I('post.key', '', 'strip_tags') . '%';
     $map['name|cn_name'] = array('like', $key);
     $count = list_pages($db, $items, $page, $this->_shownum, $map);
     // =$db->where($map)->select();
     $this->assign("items", $items);
     $this->assign("page", $page);
     $this->display("viewitems");
 }