예제 #1
0
function categoryInfo($output, $id = null)
{
    if (empty($id)) {
        if (app_param('view') == 'item') {
            $id = articleInfo('category');
        } else {
            $id = app_param('id');
        }
    }
    $output = oneQuery('article_category', 'id', $id, $output);
    return $output;
}
예제 #2
0
파일: site.php 프로젝트: mul14/FiyoCMS
                }
            }
        } else {
            if (SEF_URL) {
                if (!empty($pid) and $pid == menuInfo('id')) {
                    define('Page_ID', $pid);
                } else {
                    if (isset($_GET['pid']) and is_numeric($_GET['pid'])) {
                        define('Page_ID', pageInfo($_GET['pid'], 'id'));
                    } else {
                        $pid = @check_permalink('permalink', $_REQUEST['link'], 'pid');
                        if ($pid == 0) {
                            $pid = oneQuery('menu', 'global', 1, 'id');
                        }
                        if ($pid == 0) {
                            $pid = oneQuery('menu', 'home', 1, 'id');
                        }
                        define('Page_ID', $pid);
                    }
                }
            }
        }
    }
}
/********************************************/
/*  	  	  Delete Installer  			*/
/********************************************/
if (file_exists('system/installer/index.php')) {
    delete_directory('system/installer');
}
if (_FINDEX_ == 'BACK' and file_exists('../system/installer/index.php')) {
예제 #3
0
        notice('error', Status_Invalid);
    }
}
/****************************************/
/*		      Delete contact				*/
/****************************************/
if (isset($_POST['delete'])) {
    $source = @$_POST['check'];
    $source = multipleSelect($source);
    $delete = multipleDelete('contact', $source);
    if (isset($delete)) {
        notice('info', Contact_Deleted);
    } else {
        notice('error', Please_Select_contact);
    }
    redirect(getUrl());
}
/****************************************/
/*	 Redirect when contact-Id not found	*/
/****************************************/
if (!isset($_POST['save_edit']) and !isset($_POST['apply_edit'])) {
    if (isset($_REQUEST['view'])) {
        if ($_REQUEST['view'] == 'edit') {
            $id = $_REQUEST['id'];
            $react = oneQuery('contact', 'id', $id, 'id');
            if (!isset($react)) {
                header('location:?app=contact');
            }
        }
    }
}
예제 #4
0
파일: comment.php 프로젝트: mul14/FiyoCMS
$o = mysql_affected_rows();
$privatekey = pdfCOnfig('recaptcha_privatekey');
$publickey = pdfCOnfig('recaptcha_publickey');
echo "<div class='comment label'>{$o} Feedback</div>";
$no = 1;
while ($com = mysql_fetch_array($sql)) {
    $email = strtolower(userInfo($com['user_id']));
    $email = md5($email);
    $img = "<span class='cmn-gravatar' data-gravatar-hash='{$email}'></span>";
    if ($com['user_id'] == 1 or $com['user_id'] == 2) {
        $s = " admin-comment";
    } else {
        $s = "";
    }
    $ulink = make_permalink('?app=pdf&view=user&id=1' . $com['user_id']);
    $uname = oneQuery('user', 'id', $com['user_id'], 'name');
    $name = "<a href='{$ulink}'>{$uname}</a>";
    $comment = str_replace("<", "&lt;", $com['comment']);
    $comment = str_replace(">", "&gt;", $comment);
    $comment = str_replace("\n", "<br>", $comment);
    $comment = str_replace("[b]", "<b>", $comment);
    $comment = str_replace("[/b]", "</b>", $comment);
    $comment = str_replace("[i]", "<i>", $comment);
    $comment = str_replace("[/i]", "</i>", $comment);
    $comment = str_replace("[u]", "<u>", $comment);
    $comment = str_replace("[/u]", "</u>", $comment);
    $author_reply = $com['author_reply'];
    $author_reply = str_replace(">", "&gt;", $author_reply);
    $author_reply = str_replace("\n", "<br>", $author_reply);
    $author_reply = str_replace("[b]", "<b>", $author_reply);
    $author_reply = str_replace("[/b]", "</b>", $author_reply);
예제 #5
0
 } else {
     if ($i == 1) {
         $row[] = $name;
     } else {
         if ($i == 2) {
             $row[] = "<div class='center'>{$status}</div>";
         } else {
             if ($i == 3) {
                 $comm = htmlentities(htmlToText($aRow['comment']));
                 $comm = substr($comm, 0, 50);
                 $comm = "<a class='tips' title='" . Edit . "' href='?app=article&view=comment&act=edit&id={$aRow['id']}'>{$comm} ...</a>";
                 $row[] = "{$comm}";
             } else {
                 if ($i == 4) {
                     $title = oneQuery('article', 'id', link_param('id', $aRow['link']), 'title');
                     $link = oneQuery('permalink', 'link', "'{$aRow['link']}'", 'permalink');
                     $clink = "#comment-{$aRow['id']}";
                     $title = "<span style='display:none'>{$title}</span><a href='../{$link}{$clink} ' target='_blank' class='outlink'>{$title}</a> ";
                     $row[] = "{$title}";
                 } else {
                     if ($i == 5) {
                         $row[] = "<div class='center'>{$aRow['date']}</div>";
                     } else {
                         if ($aColumns[$i] != ' ') {
                         }
                     }
                 }
             }
         }
     }
 }
예제 #6
0
 $img = "<span class='mod-gravatar' data-gravatar-hash='{$email}'></span>";
 if ($com['user_id'] == 1 or $com['user_id'] == 2) {
     $s = " admin-comment";
 } else {
     $s = "";
 }
 echo "<div class='inner-comment{$s}'>";
 if ($gravatar) {
     echo "<div class='mod-avatar-comment'>{$img}</div>";
     echo "<div class='mod-right-comment'>";
 } else {
     echo "<div class='mod-right-comment u3'>";
 }
 $ltitle = strpos($com['link'], 'id=');
 $ltitle = substr($com['link'], $ltitle + 3);
 $ltitle = oneQuery('article', 'id', $ltitle, 'title');
 $ltitle = "<a href='" . make_permalink($com['link']) . "' title='comment permalink'>{$ltitle}</a>";
 if ($name and $title and $date) {
     echo "<span>{$com['name']}</span> <em>{$com['date']}</em><br/> on {$ltitle}";
 } else {
     if (!$name and $title and $date) {
         echo "{$ltitle} on <em>{$com['date']}</em>";
     } else {
         if ($name and $title) {
             echo "<span>{$com['name']}</span> on {$ltitle}";
         } else {
             if ($name and $date) {
                 echo "<span>{$com['name']}</span> on <em>{$com['date']}</em>";
             } else {
                 if ($name) {
                     echo "<span>{$com['name']}</span>";
예제 #7
0
파일: row_style.php 프로젝트: mul14/FiyoCMS
<?php

/**
* @name			Rows Menu
* @version		2.0
* @package		Fiyo CMS
* @copyright	Copyright (C) 2012 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.txt
*/
defined('_FINDEX_') or die('Access Denied');
echo "<ul class=\"row-nav\">";
$sql = $db->select(FDBPrefix . "menu", "*", "category='{$category}' AND status=1  AND parent_id=0 " . Level_Access, "short ASC");
$no = 1;
$sum = mysql_affected_rows();
while ($menu = mysql_fetch_array($sql)) {
    $link = make_permalink($menu['link'], $menu['id']);
    if ($sub_title == 1) {
        $subtitle = "<span>{$menu['sub_name']}</span>";
    } else {
        $subtitle = "";
    }
    $parent = oneQuery('menu', 'id', Page_ID, 'parent_id');
    if ($menu['id'] == Page_ID or $menu['id'] == $parent) {
        $a = " active";
    } else {
        $a = "";
    }
    if ($no == 1) {
        $pos = ' first';
    } else {
        if ($no == $sum) {
예제 #8
0
파일: sys_menu.php 프로젝트: mul14/FiyoCMS
        } else {
            $_SESSION['NOTICE'] = notice('info', Menu_Deleted);
        }
    } else {
        $_SESSION['NOTICE'] = notice('error', Please_Select_Menu);
    }
    redirect(getUrl());
}
/****************************************/
/*	 Redirect when menu-Id not found	*/
/****************************************/
if (!isset($_POST['save_edit']) and !isset($_POST['apply_edit'])) {
    if (isset($_REQUEST['view'])) {
        if ($_REQUEST['view'] == 'edit') {
            $id = $_REQUEST['id'];
            $review = oneQuery('menu', 'id', $id, 'id');
            if (!isset($review)) {
                header('location:?app=menu');
            }
        }
    }
}
/****************************************/
/*				 Sub Menu 				*/
/****************************************/
function sub_menu($parent_id, $pre, $nos)
{
    $db = new FQuery();
    $db->connect();
    $sql = $db->select(FDBPrefix . "menu", "*", "parent_id={$parent_id}", "short ASC");
    $no = 1;
예제 #9
0
파일: comments.php 프로젝트: mul14/FiyoCMS
    $foto = " <span class='c_gravatar' data-gravatar-hash=\"{$imgr}\"></span>";
    $comment = cutWords(htmlToText($qr['comment']), 10);
    $hide = Hide;
    $cedit = Edit;
    $read = Read;
    $delete = Delete;
    $approve = Approve;
    $app = link_param('app', "{$qr['link']}");
    $aid = link_param('id', "{$qr['link']}");
    $app = "{$qr['apps']}";
    if (empty($app)) {
        $app = 'article';
    }
    $lread = $_POST['url'] . check_permalink("link", "?app=article&view=item&id={$aid}", "permalink");
    $edit = "?app={$app}&view=comment&act=edit&id={$id}";
    $title = oneQuery('article', 'id', $aid, 'title');
    $red = '';
    if ($qr['status']) {
        $approven = "<a class='btn-tools btn btn-danger btn-sm btn-grad disable-user' title='{$hide}' data-id='{$id}'>{$hide}</a><a class='btn-tools btn btn-success btn-sm btn-grad approve-user' title='{$approve}' style='display:none;' data-id='{$id}'>{$approve}</a>";
    } else {
        $approven = "<a data-id='{$id}' class='btn-tools btn btn-success btn-sm btn-grad approve-user' title='{$approve}'>{$approve}</a><a data-id='{$id}' class='btn-tools btn btn-danger btn-sm btn-grad disable-user' title='{$hide}'  style='display:none;'>{$hide}</a>";
        $red = "class='unapproved'";
    }
    echo "<tr {$red}><td style='text-align: center; vertical-align: middle;  padding: 7px 8px 6px 10px;'>{$foto}</td><td style='width: 97%; padding: 7px 8px 8px 0;'><b>{$qr['name']}</b> <span>on</span> {$title}<a data-toggle='tooltip' data-placement='right' title='{$info}' class='icon-time tooltips'></a><a data-toggle='tooltip' data-placement='left' title='{$qr['email']}' class='icon-envelope-alt tooltips'></a>\n\t\t\t<br/><span>{$comment} ...</span><br/>\n\t\t\t<div class='tool-box tool-{$no}'>\n\t\t\t\t{$approven}\n\t\t\t\t<a href='{$edit}' class='btn btn-tools tips' title='{$cedit}'>{$cedit}</a>\n\t\t\t\t<a href='{$lread}#comment-{$qr['id']}' target='_blank'  class='btn btn-tools tips' title='{$read}'>{$read}</a>\n\t\t\t\t<!--a class='btn btn-tools tips' title='{$delete}'>{$delete}</a-->\n\t\t\t</div>\n\t\t\t</td></tr>";
    $no++;
}
if ($no < 1) {
    echo "<tr><td style='text-align:center; padding: 40px 0; color: #ccc; font-size: 1.5em'>" . No_Comment . "</td></tr>";
}
?>
    </tbody>			
예제 #10
0
    if ($qr['show_title'] == 1) {
        $sname1 = "selected";
        $sname2 = "";
        $stitle = ' show';
    } else {
        $sname2 = "selected";
        $sname1 = "";
        $stitle = 'hide';
    }
    $sname = "\n\t\t\t\t<div class='switch s-icon home'><span class='invisible'>{$stitle}</span>\n\t\t\t\t\t<label class='cb-enable {$sname1} tips' data-placement='left' title='" . Hidden_title . "'><span>\n\t\t\t\t\t<i class='icon-font'></i>\n\t\t\t\t\t</span></label>\n\t\t\t\t\t<label class='cb-disable {$sname2} tips' data-placement='left' title='" . Visible_title . "'><span>\n\t\t\t\t\t<i class='icon-font'></i></span></label>\n\t\t\t\t\t<input type='hidden' value='{$qr['id']}'  class='number invisible'>\n\t\t\t\t\t<input type='hidden' value='{$qr['show_title']}' class='type invisible'>\n\t\t\t\t</div>";
    //module name
    $name = "<a href='?app=module&act=edit&id={$qr['id']}' class='tips' data-placement='right' title='" . Edit . "'>{$qr['name']}</a>";
    //checkbox
    $check = "<input type='checkbox' name='check[]' value='{$qr['id']}' rel='ck'>";
    //creat user group values
    $level = oneQuery('user_group', 'level', "'{$qr['level']}'", 'group_name');
    if (empty($level)) {
        $level = _Public;
    }
    echo "<tr><td align='center'>{$check}</td><td>{$name}</td><td><div class='switch-group'>{$sname}{$status}</div></td><td>{$qr['position']}</td><td>{$qr['folder']}</td><td align='center'>{$qr['short']}</td><td align='center'>{$level}</td><td align='center'>{$qr['id']}</td></tr>";
    $no++;
}
?>
        </tbody>			
	</table>
</form>

<script type="text/javascript">
$(document).ready(function() {	
	CKEDITOR.replace( 'editor', {
		toolbar : 'Null',
예제 #11
0
 function category($id, $fp = null)
 {
     $db = new FQuery();
     $db->connect();
     $param = oneQuery('menu', 'id', Page_ID, 'parameter');
     $show_panel = mod_param('show_name', $param);
     $read_more = mod_param('read_more', $param);
     $per_page = mod_param('per_page', $param);
     $this->sname = mod_param('show_name', $param);
     $this->sgroup = mod_param('show_group', $param);
     $this->sgender = mod_param('show_gender', $param);
     $this->saddress = mod_param('show_address', $param);
     $this->semail = mod_param('show_email', $param);
     $this->sjob = mod_param('show_job', $param);
     $this->slinks = mod_param('show_links', $param);
     $this->sphone = mod_param('show_phone', $param);
     $this->sphoto = $sphoto = mod_param('show_photo', $param);
     $groupId = app_param('id');
     $whereCat = "AND group_id = {$id}";
     $sql = $db->select(FDBPrefix . 'contact', '*', 'status = 1 AND group_id=' . $id);
     $qr = @mysql_fetch_array($sql);
     if (empty($qr['id'])) {
         echo "<h3>Opps, Contact group is empty!";
     } else {
         loadPaging();
         $paging = new paging();
         $rowsPerPage = $per_page;
         $result = $paging->pagerQuery(FDBPrefix . 'contact', "*", "status=1 {$whereCat}", 'id ASC', $rowsPerPage);
         $no = 0;
         $sum = mysql_affected_rows();
         while ($qr = mysql_fetch_array($result)) {
             $group = oneQuery('contact_group', 'id', $qr['group_id'], 'name');
             $vlink = "?app=contact&view=person&id={$qr['id']}";
             $link = make_permalink($vlink, Page_ID);
             $title = "<a href=\"{$link}\">{$qr['name']}</a>";
             if (empty($read_more)) {
                 $read_more = "read more...";
             }
             $readmore = "<a href=\"{$link}\"class='readmore'>{$read_more}</a>";
             $comment = FQuery('comment', "link='{$vlink}'AND status=1");
             $name = "<a href='{$link}'>{$qr['name']}</a>";
             if ($sphoto == 1 and !empty($qr['photo'])) {
                 $photo = "<img src=\"{$qr['photo']}\" width=\"150px\">";
             }
             if (!empty($qr['email'])) {
                 $email = "<a href='mailto:{$qr['email']}' title=\"send mail to {$qr['name']}\">{$qr['email']}</a>";
             } else {
                 $email = "";
             }
             if (!empty($qr['photo'])) {
                 $photo = "<img src='{$qr['photo']}' title=\"{$qr['name']}'s contact photo\" />";
             }
             if (!empty($qr['tw'])) {
                 $tw = " <a href='http://twitter.com/{$qr['tw']}' title=\"follow {$qr['name']} on twitter\" target='_blank'><img src='" . FUrl . "apps/app_contact/theme/images/tw.png'></a>";
             }
             if (!empty($qr['fb'])) {
                 $fb = " <a href='http://facebook.com/{$qr['fb']}' title=\"find {$qr['name']} on facebook\" target='_blank'><img src='" . FUrl . "apps/app_contact/theme/images/fb.png'></a>";
             }
             if (!empty($qr['web'])) {
                 $web = " <a href='http://{$qr['web']}' title=\"visit {$qr['name']}'s website\" target='_blank'><img src='" . FUrl . "apps/app_contact/theme/images/web.png'></a>";
             }
             if (!empty($qr['ym'])) {
                 $ym = " <a href='ymsgr:sendIM?{$qr['ym']}' title=\"chat with {$qr['name']} via YahooMasangger\"><img src='" . FUrl . "apps/app_contact/theme/images/ym.png'></a>";
             }
             if (isset($ym) or isset($fb) or isset($tw) or isset($web)) {
                 $links = $ym . $fb . $tw . $web;
             } else {
                 $links = '';
             }
             $this->perrows = $sum;
             $this->name[$no] = $name;
             $this->photo[$no] = $photo;
             $this->group[$no] = $group;
             $this->gender[$no] = $qr['gender'];
             $this->address[$no] = $qr['city'] . ", " . $qr['country'];
             $this->email[$no] = @$qr['email'];
             $this->job[$no] = $qr['job'];
             $this->links[$no] = $links;
             $this->phone[$no] = $qr['phone'];
             $this->fax[$no] = $qr['fax'];
             $this->per_page = $per_page;
             $ym = $fb = $tw = $web = null;
             //reset $link variable;
             if (defined('SEF_URL')) {
                 $link = link_paging('?');
             } else {
                 $link = "?app=contact&view=group&id={$groupId}";
                 $link = make_permalink($link, Page_ID);
                 $link = $link . "&";
             }
             $no++;
         }
         $db->select(FDBPrefix . 'contact', '*', "status=1 {$whereCat}");
         $jml = mysql_affected_rows();
         if ($jml > $rowsPerPage) {
             $pagelink = $paging->createPaging($link);
         } else {
             $pagelink = null;
         }
         $this->pagelink = $pagelink;
     }
 }
예제 #12
0
echo $filter2;
?>
 >
					<?php 
$db = new FQuery();
$db->connect();
$sql2 = $db->select(FDBPrefix . 'article');
while ($qr2 = mysql_fetch_array($sql2)) {
    if ($value == $qr2['id']) {
        $s = 'selected';
    } else {
        $s = '';
    }
    if (!isset($a) and $a != $qr2['author_id']) {
        $a = $qr2['author_id'];
        $an = oneQuery('user', 'id', $a, 'name');
        echo "<option value='{$a}' {$s}>{$an} </option>";
    }
}
$sql3 = $db->select(FDBPrefix . 'article', '*', "id={$id}");
$qr3 = mysql_fetch_array($sql3);
?>
					</select>
					</div>
				</td>
			</tr>	
			
			<tr>
				<td class="row-title"><span class="tips" title='<?php 
echo $itemTip;
?>
예제 #13
0
		<tbody>
			<?php 
$sql = $db->select(FDBPrefix . 'contact', '*', "", "name ASC");
$no = 1;
while ($qr = mysql_fetch_array($sql)) {
    /* logika status aktif atau tidak */
    if ($qr['status'] == 1) {
        $stat1 = "selected";
        $stat2 = "";
    } else {
        $stat2 = "selected";
        $stat1 = "";
    }
    $status = "\n\t\t\t\t<p class='switch'>\n\t\t\t\t\t<label class='cb-enable {$stat1}'><span>On</span></label>\n\t\t\t\t\t<label class='cb-disable {$stat2}'><span>Off</span></label>\n\t\t\t\t\t<input type='text' value='{$qr['id']}' id='id' class='invisible'><input type='text' value='stat' id='type' class='invisible'>\n\t\t\t\t</p>";
    /* logika halaman depan */
    $group = oneQuery('contact_group', 'id', $qr['group_id'], 'name');
    $name = "<a class='edit tips link' data-placement='right' title='" . Edit . "' href='?app=contact&act=edit&id={$qr['id']}'>{$qr['name']}</a>";
    $checkbox = "<input type='checkbox' data-name='rad-{$qr['id']}' sub-target='.sub-menu' name='check[]' value='{$qr['id']}' rel='ck'>";
    if ($qr['gender'] == 1) {
        $gender = Man;
    } else {
        $gender = Woman;
    }
    echo "<tr>";
    echo "<td align='center'>{$checkbox}</td><td>{$name}</td><td>{$gender}</td><td  align='center'>{$status}</td><td>{$group}</td><td>{$qr['email']}</td><td>{$qr['phone']}</td>";
    echo "</tr>";
    $no++;
}
?>
        </tbody>			
	</table>
예제 #14
0
 function item($q, $menuId)
 {
     /* Call new FQuery */
     $db = new FQuery();
     $db->connect();
     /* Set Access_Level */
     $accessLevel = Level_Access;
     $q = str_replace("'", "", $q);
     $q = str_replace("/", "", $q);
     $q = str_replace("\\", "", $q);
     $q = str_replace('"', "", $q);
     $q = str_replace('  ', " ", $q);
     if (empty($q)) {
         $q = $_SESSION['search'];
     }
     /* Call new paging */
     loadPaging();
     $paging = new paging();
     $rowsPerPage = 10;
     $keyword = trim($q);
     //remove space before and after
     $article = explode_query($q, 'article');
     $title = explode_query($q, 'title');
     $author = explode_query($q, 'author');
     $tag = explode_query($q, 'tags');
     $condition = "{$article} {$title} {$author} {$tag}";
     $user = FQuery('user', "`name` LIKE  '%{$q}%'", 'id');
     /* Check total article by query */
     FQuery('article', "status=1 AND (`author_id` ='{$user}' {$condition}) {$accessLevel}");
     $total = mysql_affected_rows();
     /* paging query */
     $result = $paging->pagerQuery(FDBPrefix . 'article', "*,DATE_FORMAT(date,'%d %M %Y') as date,DATE_FORMAT(date,'%Y-%m-%d %H:%i:%s') as order_date", "status=1 AND (`author_id` ='{$user}' {$condition}) \n\t\t{$accessLevel}", 'order_date DESC', $rowsPerPage);
     $no = 0;
     $jml = mysql_affected_rows();
     while ($qr = mysql_fetch_array($result)) {
         //category
         $category = oneQuery('article_category', 'id', $qr['category'], 'name');
         $catlink = make_permalink("?app=article&view=category&id={$qr['category']}");
         //autho
         if (!empty($qr['author_id'])) {
             if (!empty($qr['author'])) {
                 $author = $qr['author'];
             } else {
                 $author = oneQuery('user', 'id', $qr['author_id'], 'name');
             }
         } else {
             $author = "Administrator";
         }
         $strpos = 0;
         $article = stripTags($qr['article']);
         $article2 = strtolower($article);
         $strpos = strpos("{$article2}", "{$q}");
         $query = str_replace(", ", ",", $q);
         $query = str_replace(" ,", ",", $q);
         $query = trim($query);
         if (strpos($query, ",")) {
             $query = explode(",", $query);
         } else {
             $query = explode(" ", $q);
         }
         $i = 0;
         $z = '';
         $y = '';
         foreach ($query as $v) {
             $y[$i] = $v;
             $i++;
         }
         for ($n = $i * $i - 1; $n >= 0; $n--) {
         }
         if ($strpos >= 40) {
             $strpos = $strpos - 40;
             $article2 = substr("{$article2}", $strpos);
             $strpos2 = strpos("{$article2}", " ");
             $article = substr("{$article}", $strpos + $strpos2);
             $article = "..." . $article;
         }
         $article = cutWords($article, 35);
         $article .= "...";
         $link = "?app=article&view=item&id={$qr['id']}";
         $link = make_permalink($link, Page_ID);
         $qr['title'] = search_match($qr['title'], $q);
         $article = search_match($article, $q);
         $author = search_match($author, $q);
         $category = search_match($category, $q);
         $title = "<a href=\"{$link}\">{$qr['title']}</a>";
         $readmore = null;
         $this->category[$no] = $category;
         $this->catlink[$no] = $catlink;
         $this->readmore[$no] = $readmore;
         $this->author[$no] = $author;
         $this->title[$no] = $title;
         $this->date[$no] = $qr['date'];
         $this->article[$no] = $article;
         $this->perrows = $jml;
         $this->total = $total;
         if (defined('SEF_URL')) {
             $link = link_paging('?');
         } else {
             $link = "?app=article&view=category&id={$categoryId}";
             $link = make_permalink($link, Page_ID);
             $link = $link . "&";
         }
         $no++;
     }
     FQuery('article', "status=1 AND (`author_id` ='{$user}' {$condition}) {$accessLevel}");
     $jml = mysql_affected_rows();
     if ($jml > $rowsPerPage) {
         $pagelink = $paging->createPaging($link);
     } else {
         $pagelink = null;
     }
     if (strpos(getUrl(), '?q')) {
         $pagelink = str_replace("?page=", "&page=", $pagelink);
     }
     $this->pglink = $pagelink;
 }
예제 #15
0
파일: function.php 프로젝트: mul14/FiyoCMS
function multipleDelete($table, $source, $item = null, $cat = null, $except = null, $sub = null)
{
    $db = new FQuery();
    $del = explode(",", $source);
    if (!isset($except)) {
        $except = null;
    } else {
        $except = $except;
    }
    if (!empty($cat)) {
        $cat = $fid = $cat;
    } else {
        $cat = 'category';
        $fid = 'id';
    }
    if (isset($source)) {
        foreach ($del as $id) {
            if (!empty($item)) {
                if (!empty($except)) {
                    $art = $db->select(FDBPrefix . "{$item}", '*', "{$except} AND {$cat} ='{$id}'");
                } else {
                    $art = $db->select(FDBPrefix . "{$item}", '*', "{$cat} ='{$id}'");
                }
                if (@mysql_num_rows($art) > 0) {
                    $noempty = 1;
                    break;
                }
                if (!isset($noempty)) {
                    if (!empty($sub)) {
                        if (!oneQuery($table, 'parent_id', $id)) {
                            $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'");
                        } else {
                            $noempty = 1;
                        }
                    } else {
                        $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'");
                    }
                } else {
                    $noempty = 1;
                }
            } else {
                if (isset($sub)) {
                    if (!oneQuery($table, 'parent_id', $id)) {
                        $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'");
                    } else {
                        $noempty = 1;
                    }
                } else {
                    $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'");
                }
            }
        }
    }
    if (isset($qr)) {
        return 1;
    } else {
        if (isset($noempty)) {
            return 'noempty';
        } else {
            return null;
        }
    }
}
예제 #16
0
파일: insert.php 프로젝트: mul14/FiyoCMS
         $filter = 0;
     }
 }
 if (!$name and $_SESSION['USER_LEVEL'] != 1 and $_SESSION['USER_LEVEL'] != 2) {
     $status = "error";
     $notice = comment_Notice_Error3;
 } else {
     if (!$filter) {
         $status = "error";
         $notice = comment_Notice_Error4;
     } else {
         if (strlen($_POST['text']) < 10) {
             $status = "error";
             $notice = comment_Notice_Error6;
         } else {
             $auto = oneQuery('comment_setting', 'name', "'auto_submit'", 'value');
             if ($auto == 0) {
                 if ($_SESSION['USER_LEVEL'] == 1 or $_SESSION['USER_LEVEL'] == 2) {
                     $auto = 1;
                 } else {
                     $auto = null;
                 }
             }
             $no = null;
             $_POST['url'] = str_replace("<", "&lt;", $_POST['url']);
             $_POST['url'] = str_replace(">", "&gt;", $_POST['url']);
             $_POST['url'] = str_replace(" ", "", $_POST['url']);
             $_POST['url'] = str_replace("  ", "", $_POST['url']);
             $text = htmlentities($_POST['text']);
             $parent = 1;
             $apps = app_param();
예제 #17
0
파일: view_menu.php 프로젝트: mul14/FiyoCMS
</th>
				<th style="width:5% !important; text-align: center;" class='hidden-xs hidden-sm'><?php 
echo Short;
?>
</th>
				<th style="width:15% !important; text-align: center;" class='hidden-xs'><?php 
echo Access_Level;
?>
</th>
				<th style="width:6% !important; text-align: center;">ID</th>
			</tr>
		</thead>		
		<tbody>
			<?php 
//start query to get home page value.
$cat_default = oneQuery('menu', 'home', 1, 'category');
if (!empty($cat_default)) {
    $cat_default = " AND category='{$cat_default}'";
}
if (isset($_REQUEST['cat'])) {
    $cat = $_REQUEST['cat'];
    $sql = $db->select(FDBPrefix . 'menu', '*', "parent_id=0 AND category='{$cat}'", "short ASC");
} else {
    $cat = $_REQUEST['cat'] = null;
    $sql = $db->select(FDBPrefix . 'menu', '*', "parent_id=0 {$cat_default}", "short ASC");
}
$no = 1;
while ($qr = mysql_fetch_array($sql)) {
    if ($qr['status'] == 1) {
        $stat1 = "selected";
        $stat2 = "";
예제 #18
0
					 </i>
					</span>
				 </div>
				</td>
			</tr>
			<tr>
				<td class="row-title" style="width: 35%" title="<?php 
echo Editor_tip;
?>
"><?php 
echo Editor;
?>
</td>
				<td><input type="text" disabled value="<?php 
if (!empty($qr['editor'])) {
    echo oneQuery("user", "id", $qr['editor'], "name");
}
?>
" style="min-width: 83.5%" size="18"></td>
			</tr>
			<tr>
				<td class="row-title" title="<?php 
echo Editor_level_tip;
?>
" style="width:30%"><?php 
echo Editor_Level;
?>
</td>
				<td><select name="param12" placeholder="">
				<option value=""></option>
					<?php 
예제 #19
0
파일: view_user.php 프로젝트: mul14/FiyoCMS
				<th style="width:5% !important; text-align: center;" class="no">Status</th>
				<th style="width:25% !important; text-align: center;">Group</th>
				<th style="width:25% !important;">Email</th>
				<th style="width:5% !important;text-align: center;">ID</th>
			</tr>
		</thead>
		<tbody>
		<?php 
$db = new FQuery();
$db->connect();
$UserLevel = userInfo('level');
$sql = $db->select(FDBPrefix . 'user', '*', "level >= {$UserLevel}", "status ASC, ID DESC");
$no = 1;
while ($qr = mysql_fetch_array($sql)) {
    $checkbox = null;
    $group = oneQuery("user_group", "level", $qr['level'], 'group_name');
    if ($qr['status'] == 1) {
        $stat1 = "selected";
        $stat2 = "";
    } else {
        $stat2 = "selected";
        $stat1 = "";
    }
    $UserId = userInfo('id');
    if ($qr['status'] == 1) {
        $stat1 = "selected";
        $stat2 = "";
        $enable = ' enable';
    } else {
        $stat2 = "selected";
        $stat1 = "";
예제 #20
0
파일: sys_pdf.php 프로젝트: mul14/FiyoCMS
 function category($id, $menuId, $fp = null)
 {
     //validation page type
     $categoryName = $categoryDesc = null;
     $label = app_param('label');
     if ($id > 0) {
         $flag = FQuery("pustaka_category", "id={$id}", '', 1);
     } else {
         if (!empty($label)) {
             $label = app_param('label');
             $label = str_replace("-", " ", $label);
             $label = "AND tags LIKE '%" . $label . "%' ";
         }
         $flag = true;
     }
     //if page type is valid
     if ($flag) {
         $db = new FQuery();
         $db->connect();
         /************** Parameter Page ***************/
         $per_page = 10;
         $categoryId = $id;
         if (empty($param)) {
             $show_panel = 1;
             $per_page = 10;
         }
         if (url_param('feed') == 'rss') {
             $per_page = 10;
             $pages = url_param('page');
             if ($pages != null) {
                 $link = str_replace("?page={$pages}", "", getUrl());
                 redirect("{$link}?feed=rss");
             }
         }
         if (isset($label)) {
             $per_page = 10;
         }
         if (empty($per_page)) {
             $per_page = 10;
         }
         //$fp is default page
         if (!isset($fp) and !isset($label)) {
             $categoryName = oneQuery('pustaka_category', 'id', $categoryId, 'name');
             $categoryDesc = oneQuery('pustaka_category', 'id', $categoryId, 'description');
         }
         $level_access = Level_Access;
         //$if category id is not found
         if (!$categoryId and !isset($fp) and !isset($label)) {
             echo pustaka_Page_Notfound;
         } else {
             if (isset($categoryName)) {
                 $whereCat = "AND category = {$categoryId}";
             } else {
                 $whereCat = null;
             }
             //call paging class
             loadPaging();
             $paging = new paging();
             $rowsPerPage = $per_page;
             //paging results
             $result = $paging->pagerQuery(FDBPrefix . 'pustaka_file', "*", "status=1 {$whereCat} {$label}", 'id DESC', $rowsPerPage);
             $no = 0;
             //count rows
             $jml = mysql_affected_rows();
             while ($qr = mysql_fetch_array($result)) {
                 /********** File Author ***********/
                 $author = $qr['author'];
                 /********** File Category ***********/
                 $catlink = categoryLink($qr['category']);
                 $category = oneQuery('pustaka_category', 'id', $qr['category'], 'name');
                 $category = "<a href='{$catlink}' title='See more {$category}'>{$category}</a>";
                 /********** pdf Link ***********/
                 $flink = "?app=pdf&view=item&id={$qr['id']}";
                 $link = make_permalink($flink, Page_ID);
                 $title = "<a href='{$link}'>{$qr['title']}</a>";
                 /********** File Labels ***********/
                 $labels = labelToLink($qr['tags']);
                 /********** File Compability ***********/
                 $this->perrows = $jml;
                 $this->show_panel = $show_panel;
                 $this->category[$no] = $category;
                 $this->catlink[$no] = $catlink;
                 $this->author[$no] = $author;
                 $this->title[$no] = $title;
                 $this->link[$no] = $link;
                 $this->labels[$no] = $labels;
                 $this->date[$no] = $qr['year'];
                 $this->hits[$no] = $qr['hits'];
                 $this->desc[$no] = $qr['description'];
                 if (url_param('feed') == 'rss' and url_param('feed') == 'rss' or app_param('label')) {
                     $this->description[$no] = $qr['description'];
                 }
                 if (defined('SEF_URL')) {
                     $link = link_paging('?');
                 } else {
                     if (checkhomepage()) {
                         $link = "?";
                     } else {
                         $link = "?app=pdf&view=category&id={$categoryId}";
                         $link = make_permalink($link, Page_ID);
                         $link = $link . "&";
                     }
                 }
                 $no++;
             }
             if ($no == 0) {
                 echo "<h1 style='margin:20px auto'>Pustaka Kosong !!!!</h1>";
             }
             //start paging links
             $db->select(FDBPrefix . 'pustaka_file', '*', "status=1 {$whereCat}  {$level_access}");
             $jml = mysql_affected_rows();
             if ($jml > $rowsPerPage) {
                 $pagelink = $paging->createPaging($link);
             } else {
                 $pagelink = null;
             }
             //send paging var relsult
             $this->pglink = $pagelink;
             //if parameter found rss page
             if (url_param('feed') == 'rss' and url_param('feed') == 'rss' or app_param('label')) {
                 $this->catName = $categoryName;
                 $this->catDesc = $categoryDesc;
             }
         }
     } else {
         pustaka_Page_Notfound;
     }
 }
예제 #21
0
파일: edit_menu.php 프로젝트: mul14/FiyoCMS
" name="apply_edit"><i class="icon-ok"></i> <?php 
echo Save;
?>
</button>	
				<button type="submit" class="delete btn btn-metis-2" title="<?php 
echo Save_and_Quit;
?>
" value="<?php 
echo Save_and_Quit;
?>
" name="save_edit"><i class="icon-ok-sign"></i> <?php 
echo Save_and_Quit;
?>
</button>				
				<a class="danger btn btn-default btn-sm btn-grad" href="?app=menu&cat=<?php 
echo oneQuery('menu', 'id', $_GET['id'], 'category');
?>
" title="<?php 
echo Cancel;
?>
"><i class="icon-remove-sign"></i> <?php 
echo Cancel;
?>
</a>				
			</div><?php 
printAlert();
?>
		 </div>			 
	</div>
	
		
예제 #22
0
    $source = multipleSelect($source);
    $delete = multipleDelete('module', $source);
    if (isset($delete)) {
        $_SESSION['NOTICE_REF'] = alert('info', Module_Deleted);
    } else {
        $_SESSION['NOTICE_REF'] = alert('error', Module_Not_Selected);
    }
}
/****************************************/
/*	 Redirect when Module-Id not found	*/
/****************************************/
if (!isset($_POST['save_edit']) and !isset($_POST['apply_edit'])) {
    if (isset($_REQUEST['act'])) {
        if ($_REQUEST['act'] == 'edit') {
            $id = $_REQUEST['id'];
            $react = oneQuery('module', 'id', $id, 'id');
            if (!isset($react)) {
                header('location:?app=module');
            }
        }
    }
}
function option_sub_menu($parent_id, $sub = null, $pre = null, $page)
{
    $db = new FQuery();
    $db->connect();
    $sql = $db->select(FDBPrefix . "menu", "*", "parent_id={$parent_id}");
    while ($qr = mysql_fetch_array($sql)) {
        $sel = multipleSelected($page, $qr['id']);
        if ($sel == 'selected') {
            $sel = "class='active' checked";
예제 #23
0
<table class="table table-striped tools">
  <tbody>
	<?php 
$db = new FQuery();
$db->connect();
$sql = $db->select(FDBPrefix . "user", "*,DATE_FORMAT(time_reg,'%W, %Y-%m-%d %H:%i') as date", "", 'time_reg DESC LIMIT 10');
$no = 1;
while ($qr = mysql_fetch_array($sql)) {
    $id = $qr['id'];
    $edit = Edit;
    $read = Read;
    $hide = Set_disable;
    $delete = Delete;
    $approve = Set_enable;
    $sql2 = $db->select(FDBPrefix . "user_group", "*", "level={$qr['level']}");
    $output = oneQuery('session_login', 'user_id', "'{$id}'");
    $log = "";
    if ($output) {
        $log = "\n\t\t\t<a data-toggle='tooltip' data-placement='right' title='Online' class=' icon-circle blink icon-mini tooltips'></a>&nbsp;&nbsp;&nbsp;";
    }
    $red = '';
    if ($qr['status']) {
        $approven = "<a class='btn-tools btn btn-danger btn-sm btn-grad disable-user' data-id='{$qr['id']}' title='{$hide}'>{$hide}</a><a class='btn-tools btn btn-success btn-sm btn-grad approve-user' data-id='{$qr['id']}' title='{$approve}' style='display:none;'>{$approve}</a>";
    } else {
        $approven = "<a class='btn-tools btn btn-success btn-sm btn-grad approve-user' data-id='{$qr['id']}' title='{$approve}'>{$approve}</a><a class='btn-tools btn btn-danger btn-sm btn-grad disable-user' data-id='{$qr['id']}' title='{$hide}' style='display:none;'>{$hide}</a>";
        $red = "class='unapproved'";
    }
    if ($id == USER_ID) {
        $approven = '';
    }
    $group = mysql_fetch_array($sql2);
예제 #24
0
파일: category.php 프로젝트: mul14/FiyoCMS
     $catx .= $cato;
     $no++;
 }
 if ($cat) {
     $catn = "{$catx}";
 } else {
     $catn = "";
 }
 $filter = "date >= {$start}";
 $archveQuery = $db->select(FDBPrefix . "article", "*,DATE_FORMAT(date,'%m') as m,DATE_FORMAT(date,'%M') as mo,DATE_FORMAT(date,'%d-%b') as month,DATE_FORMAT(date,'%Y') as y", " {$filter} AND {$catn}", "category ASC");
 $no = $x = 0;
 while ($archveRow = mysql_fetch_array($archveQuery)) {
     $link = "?app=article&view=item&id={$archveRow['id']}";
     $link = make_permalink($link);
     if ($archveRow['date'] >= $start and $archveRow['date'] <= $end) {
         $catname = oneQuery('article_category', 'id', "{$archveRow['category']}", 'name');
         $s = FQuery('article', "category = {$archveRow['category']} AND status = 1");
         if (isset($m) and $m != $archveRow['category']) {
             echo "</ul></li></ul>";
         }
         if (@$m != $archveRow['category']) {
             $open = '';
             if (app_param('app') == 'article' and (app_param('view') == 'category' or app_param('view') == 'item')) {
                 if (articleInfo('category') == "{$archveRow['category']}") {
                     $open = " open";
                 }
             }
             echo "\n\t\t\t\t<ul class='mod-article-archive'>\n\t\t\t\t\t<li class='archive-head'><a class='archive-head-a'>{$catname}  ({$s})</a>\n\t\t\t\t<ul class='archive-list{$open}'>";
         }
         if ($archveRow['status'] == 1) {
             $active = '';
예제 #25
0
    if (delete_directory("../plugins/{$folder}")) {
        $a = "folder <i>folder/{$folder}</i> " . has_ben_deleted . ".<br>";
    }
    $qr = $db->delete(FDBPrefix . 'plugins', "folder='{$folder}'");
    $b = "tabel <i>{$folder}</i> " . has_ben_deleted . ".<br>";
    alert('info', "{$a} {$b}");
}
$dir = opendir("../plugins");
$no = 1;
while ($folder = readdir($dir)) {
    if ($folder == "." or $folder == "..") {
        continue;
    }
    if (!preg_match("/[\\.]/i", $folder)) {
        $stat = oneQuery('plugin', 'folder', "'{$folder}'", 'status');
        $plgid = oneQuery('plugin', 'folder', "'{$folder}'", 'id');
        if ($stat == 1) {
            $stat1 = "selected";
            $stat2 = "";
        } else {
            $stat2 = "selected";
            $stat1 = "";
        }
        $status = "\n\t\t\t\t\t<p class='switch'>\n\t\t\t\t\t\t<label class='cb-enable {$stat1}'><span>On</span></label>\n\t\t\t\t\t\t<label class='cb-disable {$stat2}'><span>Off</span></label>\n\t\t\t\t\t\t<input type='text' value='{$plgid}' id='id' class='invisible'><input type='text' value='stat' id='type' class='invisible'>\n\t\t\t\t\t</p>";
        $file = "../plugins/{$folder}/plg_details.php";
        if (file_exists($file)) {
            include $file;
            $file = "../plugins/{$folder}/plg_params.php";
            $popup = '';
            if (file_exists($file)) {
                echo "<tr><td><a title=\"{$plg_desc}\" class=\"popup cedit plg_prm\" href=\"?app=addons&act=plugin_params&folder={$folder}\" rel=\"width:500;height:400\">{$plg_name}</a>";
예제 #26
0
/**
* @version		1.5.0
* @package		Fiyo CMS
* @copyright	Copyright (C) 2012 Fiyo CMS.
* @license		GNU/GPL, see LICENSE.txt
* @description	
**/
defined('_FINDEX_') or die('Access Denied');
$db = @new FQuery() or die;
$db->connect();
$auto = oneQuery('comment_setting', 'name', "'auto_submit'", 'value');
$name = oneQuery('comment_setting', 'name', "'name_filter'", 'value');
$email = oneQuery('comment_setting', 'name', "'email_filter'", 'value');
$filter = oneQuery('comment_setting', 'name', "'word_filter'", 'value');
$public_key = oneQuery('comment_setting', 'name', "'recaptcha_publickey'", 'value');
$private_key = oneQuery('comment_setting', 'name', "'recaptcha_privatekey'", 'value');
?>

<script type="text/javascript">
	$(function() {
		$(".cb-enable").click(function(){
			var parent = $(this).parents('.switch');
			$('.cb-disable',parent).removeClass('selected');
			$(this).addClass('selected');
		});
		$(".cb-disable").click(function(){
			var parent = $(this).parents('.switch');
			$('.cb-enable',parent).removeClass('selected');
			$(this).addClass('selected');
		});	
	});
예제 #27
0
    if ($id == $qr2['id']) {
        $s = 'selected';
    } else {
        $s = '';
    }
    echo "<option value='{$qr2['id']}' {$s}>{$qr2['name']}</option>";
}
?>
					</select>
					
					<input type="hidden" value="?app=contact&view=item&id=<?php 
echo $id;
?>
" id="pgs" size="20" readonly /> 
					<input type="text" value="<?php 
echo oneQuery('contact', 'id', $id, 'name');
?>
" id="pg" size="20" readonly /> 
					<a class="popup pop_up2 invisible" href="#pages" rel="width:940;height:400" style="margin-right:-20px;">Select contact</a>
				</td>
			</tr>	
			<!-- Tipe tampilan menu -->
			<tr class="per_page">
				<td class="djudul" id="contact_sum">Contact per page</td>
				<td>
					<input type="text" name="param1" value="<?php 
echo $perpage;
?>
" id="per_page" size="5" />
					</td>
			</tr>			
예제 #28
0
파일: index.php 프로젝트: mul14/FiyoCMS
                        $com = $db->insert(FDBPrefix . 'comment', array("", "{$link}", $_SESSION['USER_ID'], "{$_POST['name']}", "{$_POST['email']}", "{$_POST['web']}", date("Y-m-d H:i:s", time()), "{$text}", "{$auto}", "{$apps}", "{$parent}", "{$parent}", "{$parent}"));
                        if ($com and $auto) {
                            $notice = alert("info", comment_Notice_Info, true);
                        } else {
                            $notice = alert("info", comment_Notice_Info2, true);
                        }
                        if (empty($no)) {
                            $no = 1;
                        }
                        //Comment will appear after page reload
                        $link = "{$go_link}#comment-{$no}";
                    }
                }
            } else {
                $notice = alert("error", comment_Notice_Error5, true);
            }
        }
    }
}
//name
$name = $_SESSION['USER_NAME'];
if (empty($name)) {
    $name = @$_POST['name'];
}
//email
$email = oneQuery('comment_setting', 'name', "'email_filter'", 'value');
$email = $_SESSION['USER_EMAIL'];
if (empty($email)) {
    $email = @$_POST['email'];
}
require 'form_comment.php';
예제 #29
0
function option_sub_cat($parent_id, $pre)
{
    $db = new FQuery();
    $db->connect();
    if (!isset($_REQUEST['id']) or $_REQUEST['act'] == 'add') {
        $sql = $db->select(FDBPrefix . "article_category", "*", "parent_id={$parent_id}");
    } else {
        $sql = $db->select(FDBPrefix . "article_category", "*", "parent_id={$parent_id} AND id != {$_REQUEST['id']}");
    }
    while ($qr = @mysql_fetch_array($sql)) {
        if ($qr['level'] >= $_SESSION['USER_LEVEL']) {
            $scat = $pcat = 0;
            if (isset($_REQUEST['id'])) {
                $scat = oneQuery('article', 'id', $_REQUEST['id'], 'category');
                $pcat = oneQuery('article_category', 'id', $scat, 'parent_id');
            }
            if ($pcat == $qr['id'] or $scat == $qr['id']) {
                $s = "selected";
            } else {
                $s = "";
            }
            echo "<option value='{$qr['id']}' {$s}>{$pre}|_ {$qr['name']}</option>";
            option_sub_cat($qr['id'], $pre . "&nbsp;&nbsp;&nbsp;&nbsp;");
        }
    }
}