示例#1
0
 function getNiceTopicPathFromId($funcURL)
 {
     $xt = new XoopsTree($this->table, "topic_id", "topic_pid");
     $ret = $xt->getNicePathFromId($this->topic_id, "toppic_title", $funcURL);
     return $ret;
 }
示例#2
0
 $groupsql = filemgmt_buildAccessSql();
 $sql = "SELECT COUNT(*) FROM {$_FM_TABLES['filemgmt_filedetail']} a ";
 $sql .= "LEFT JOIN {$_FM_TABLES['filemgmt_cat']} b ON a.cid=b.cid ";
 $sql .= "WHERE a.lid='{$lid}' {$groupsql} AND a.status > 0";
 list($fileAccessCnt) = DB_fetchArray(DB_query($sql));
 if ($fileAccessCnt > 0 and DB_count($_FM_TABLES['filemgmt_filedetail'], "lid", $lid) == 1) {
     $p->set_var('block_header', COM_startBlock("<b>" . $LANG_FILEMGMT['plugin_name'] . "</b>"));
     $p->set_var('block_footer', COM_endBlock());
     require_once $_CONF['path_system'] . 'lib-comment.php';
     $sql = "SELECT d.lid, d.cid, d.title, d.url, d.homepage, d.version, d.size, d.logourl, d.submitter, d.status, d.date, ";
     $sql .= "d.hits, d.rating, d.votes, d.comments, t.description FROM {$_FM_TABLES['filemgmt_filedetail']} d, ";
     $sql .= "{$_FM_TABLES['filemgmt_filedesc']} t WHERE d.lid='{$lid}' AND d.lid=t.lid AND status > 0";
     $result = DB_query($sql);
     list($lid, $cid, $dtitle, $url, $homepage, $version, $size, $logourl, $submitter, $status, $time, $hits, $rating, $votes, $comments, $description) = DB_fetchArray($result);
     $pathstring = '<a href="' . $_CONF['site_url'] . '/filemgmt/index.php">' . _MD_MAIN . '</a>&nbsp;:&nbsp;';
     $nicepath = $mytree->getNicePathFromId($cid, "title", "{$_CONF['site_url']}/filemgmt/viewcat.php");
     $pathstring .= $nicepath;
     $p->set_var('category_path_link', $pathstring);
     $rating = number_format($rating, 2);
     $dtitle = $myts->makeTboxData4Show($dtitle);
     $url = $myts->makeTboxData4Show($url);
     $homepage = $myts->makeTboxData4Show($homepage);
     $version = $myts->makeTboxData4Show($version);
     $size = $myts->makeTboxData4Show($size);
     $platform = $myts->makeTboxData4Show($platform);
     $logourl = $myts->makeTboxData4Show($logourl);
     $datetime = formatTimestamp($time);
     $description = $myts->makeTareaData4Show($description, 0);
     //no html
     $result2 = DB_query("SELECT username,fullname,photo FROM {$_TABLES['users']} WHERE uid = {$submitter}");
     list($submitter_name, $submitter_fullname, $photo) = DB_fetchArray($result2);
示例#3
0
//  ------------------------------------------------------------------------ //
include "header.php";
include_once XOOPS_ROOT_PATH . "/class/xoopstree.php";
$myts =& MyTextSanitizer::getInstance();
// MyTextSanitizer object
$mytree = new XoopsTree($xoopsDB->prefix("mydownloads_cat"), "cid", "pid");
// Used to view just a single DL file information. Called from the rating pages
$lid = intval($_GET['lid']);
$cid = intval($_GET['cid']);
$xoopsOption['template_main'] = 'mydownloads_singlefile.html';
include XOOPS_ROOT_PATH . "/header.php";
$q = "SELECT d.lid, d.cid, d.title, d.url, d.homepage, d.version, d.size, d.platform, d.logourl, d.status, d.date, d.hits, d.rating, d.votes, d.comments, t.description FROM " . $xoopsDB->prefix("mydownloads_downloads") . " d, " . $xoopsDB->prefix("mydownloads_text") . " t WHERE d.lid={$lid} AND d.lid=t.lid AND status>0";
$result = $xoopsDB->query($q);
list($lid, $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result);
$pathstring = "<a href='index.php'>" . _MD_MAIN . "</a>&nbsp;:&nbsp;";
$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
$xoopsTpl->assign('category_path', $pathstring);
$path = $mytree->getPathFromId($cid, "title");
$path = substr($path, 1);
$path = str_replace("/", " <img src='" . XOOPS_URL . "/modules/mydownloads/images/arrow.gif' board='0' alt=''> ", $path);
$rating = number_format($rating, 2);
$dtitle = $myts->makeTboxData4Show($title);
$url = $myts->makeTboxData4Show($url);
$homepage = $myts->makeTboxData4Show($homepage);
$version = $myts->makeTboxData4Show($version);
$size = PrettySize($myts->makeTboxData4Show($size));
$platform = $myts->makeTboxData4Show($platform);
$logourl = $myts->makeTboxData4Show($logourl);
$datetime = formatTimestamp($time, "s");
$description = $myts->makeTareaData4Show($description, 0);
//no html
示例#4
0
	function getNicePathFromId($funcURL){
		$xt = new XoopsTree($this->table, "id", "pid");
		$ret = $xt->getNicePathFromId($this->id, "title", $funcURL);
		return $ret;
	}
示例#5
0
    if ($max_h / $max_w > $p['res_y'] / $p['res_x']) {
        if ($p['res_x'] > $max_w) {
            $photo['width_height'] = "width='{$max_w}'";
        }
    } else {
        if ($p['res_y'] > $max_h) {
            $photo['width_height'] = "height='{$max_h}'";
        }
    }
}
$xoopsTpl->assign_by_ref('photo', $photo);
// Category Information
$cid = empty($p['cid']) ? $cid : $p['cid'];
$xoopsTpl->assign('category_id', $cid);
$cids = $cattree->getAllChildId($cid);
$sub_title = preg_replace("/\\'\\>/", "'><img src='{$mod_url}/images/folder16.gif' alt='' />", $cattree->getNicePathFromId($cid, 'title', "viewcat.php?num=" . intval($myalbum_perpage)));
$sub_title = preg_replace("/^(.+)folder16/", '$1folder_open', $sub_title);
$xoopsTpl->assign('album_sub_title', $sub_title);
// Orders
include XOOPS_ROOT_PATH . "/modules/{$mydirname}/include/photo_orders.php";
if (isset($_GET['orderby']) && isset($myalbum_orders[$_GET['orderby']])) {
    $orderby = $_GET['orderby'];
} else {
    if (isset($myalbum_orders[$myalbum_defaultorder])) {
        $orderby = $myalbum_defaultorder;
    } else {
        $orderby = 'lidA';
    }
}
// create category navigation
$fullcountresult = $xoopsDB->query("SELECT lid FROM {$table_photos} WHERE cid={$cid} AND status>0 ORDER BY {$myalbum_orders[$orderby][0]}");
示例#6
0
$complement = '';
if (news_getmoduleoption('enhanced_pagenav') && (isset($arr_titles) && is_array($arr_titles) && isset($arr_titles, $storypage) && $storypage > 0)) {
    $complement = ' - ' . $arr_titles[$storypage];
}
$xoopsTpl->assign('xoops_pagetitle', $article->title() . $complement . ' - ' . $article->topic_title() . ' - ' . $xoopsModule->name('s'));
if (news_getmoduleoption('newsbythisauthor')) {
    $xoopsTpl->assign('news_by_the_same_author_link', sprintf("<a href='%s?uid=%d'>%s</a>", XOOPS_URL . '/modules/news/newsbythisauthor.php', $article->uid(), _NW_NEWSSAMEAUTHORLINK));
}
/**
 * Create a clickable path from the root to the current topic (if we are viewing a topic)
 * Actually this is not used in the default's templates but you can use it as you want
 * Uncomment the code to be able to use it
 */
if ($cfg['create_clickable_path']) {
    $mytree = new XoopsTree($xoopsDB->prefix('topics'), 'topic_id', 'topic_pid');
    $topicpath = $mytree->getNicePathFromId($article->topicid(), 'topic_title', 'index.php?op=1');
    $xoopsTpl->assign('topic_path', $topicpath);
    unset($mytree);
}
/**
 * Summary table
 *
 * When you are viewing an article, you can see a summary table containing
 * the first n links to the last published news.
 * This summary table is visible according to a module's option (showsummarytable)
 * The number of items is equal to the module's option "storyhome" ("Select the number
 * of news items to display on top page")
 * We also use the module's option "restrictindex" ("Restrict Topics on Index Page"), like
 * this you (the webmaster) select if users can see restricted stories or not.
 */
if (news_getmoduleoption('showsummarytable')) {
示例#7
0
}
/**
* Create the website navigation's bar
*/
if (getmoduleoption('sitenavbar')) {
    $content = CreateSiteNavBar();
    $xoopsTpl->assign("xoops_module_header", $content);
}
/**
 * Create a clickable path from the root to the current topic (if we are viewing a topic)
 * Actually this is not used in the default templates but you can use it as you want
 * You can comment the code to optimize the requests count
 */
if ($xoopsOption['storytopic']) {
    $mytree = new XoopsTree($xoopsDB->prefix("topics"), "topic_id", "topic_pid");
    $topicpath = $mytree->getNicePathFromId($xoopsOption['storytopic'], "topic_title", "index.php?op=1");
    $xoopsTpl->assign('topic_path', $topicpath);
    unset($mytree);
}
/**
 * Create a link for the RSS feed (if the module's option is activated)
 */
if ($xoopsModuleConfig['topicsrss'] && $xoopsOption['storytopic']) {
    $link = sprintf("<a href='%s' title='%s'><img src='%s' border=0 alt='%s'></a>", XOOPS_URL . "/modules/news/backendt.php?topicid=" . $xoopsOption['storytopic'], _NW_RSSFEED, XOOPS_URL . "/modules/news/images/rss.gif", _NW_RSSFEED);
    $xoopsTpl->assign('topic_rssfeed_link', $link);
}
/**
 * Assign page's title
 */
if ($firsttitle != '') {
    $xoopsTpl->assign('xoops_pagetitle', $myts->htmlSpecialChars($firsttitle) . ' - ' . $myts->htmlSpecialChars($xoopsModule->name()));
示例#8
0
        $whr .= "AND (CONCAT( l.title , l.ext , c.title ) LIKE '%" . addslashes($keyword) . "%') ";
    }
}
// query for listing
$rs = $xoopsDB->query("SELECT count(l.lid) FROM {$table_photos} l LEFT JOIN {$table_cat} c ON l.cid=c.cid WHERE {$whr}");
list($numrows) = $xoopsDB->fetchRow($rs);
$prs = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.submitter, l.ext, t.description,t.arrowhtml,t.addinfo FROM {$table_photos} l LEFT JOIN {$table_cat} c ON l.cid=c.cid LEFT JOIN {$table_text} t ON l.lid=t.lid WHERE {$whr} ORDER BY l.lid DESC LIMIT {$pos},{$num}");
// Page Navigation
$nav = new XoopsPageNav($numrows, $num, $pos, 'pos', "num={$num}&txt=" . urlencode($txt));
$nav_html = $nav->renderNav(7);
// beggining of Output
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
// check $xoopsModule
if (!is_object($xoopsModule)) {
    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
}
echo "<h3 style='text-align:left;'>" . sprintf(_MD_A_GNAVI_FMT_ADMISSION, $xoopsModule->name()) . "</h3>\n";
echo "\n<p><font color='blue'>" . (isset($_GET['mes']) ? $_GET['mes'] : "") . "</font></p>\n<table width='95%' border='0' cellpadding='4' cellspacing='0'><tr><td>\n<form action='' method='GET' style='margin-bottom:0px;text-align:right'>\n  <input type='hidden' name='num' value='{$num}'>\n  <input type='text' name='txt' value='" . htmlspecialchars($txt, ENT_QUOTES) . "'>\n  <input type='submit' value='" . _MD_A_GNAVI_BUTTON_EXTRACT . "' /> &nbsp; \n  <input type='hidden'name='page' value='admission'>\n  {$nav_html} &nbsp; \n</form>\n<form name='MainForm' action='' method='POST' style='margin-top:0px;'>\n" . $xoopsGTicket->getTicketHtml(__LINE__) . "\n<input type='hidden' name='action' value='' />\n<table width='95%' class='outer' cellpadding='4' cellspacing='1'>\n  <tr valign='middle'>\n    <th width='5'><input type='checkbox' name='dummy' onclick=\"with(document.MainForm){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=this.checked;}}}\" /></th>\n    <th></th>\n    <th>" . _MD_A_GNAVI_TH_SUBMITTER . "</th>\n    <th>" . _MD_A_GNAVI_TH_TITLE . "</th>\n    <th>" . _MD_A_GNAVI_TH_DESCRIPTION . "</th>\n    <th>" . _MD_A_GNAVI_TH_CATEGORIES . "</th>\n  </tr>\n";
// Listing
$oddeven = 'odd';
while (list($lid, $cid, $title, $submitter, $ext, $description) = $xoopsDB->fetchRow($prs)) {
    $oddeven = $oddeven == 'odd' ? 'even' : 'odd';
    $title = $myts->makeTboxData4Show($title);
    $description = $myts->displayTarea($description, 0, 1, 1, 0, 1, 1);
    $cat = $cattree->getNicePathFromId($cid, "title", "../index.php?");
    $editbutton = "<a href='" . XOOPS_URL . "/modules/{$mydirname}/index.php?page=submit&lid={$lid}' target='_blank'><img src='" . XOOPS_URL . "/modules/{$mydirname}/images/editicon.gif' border='0' alt='" . _MD_GNAV_SMT_EDITITEM . "' title='" . _MD_GNAV_SMT_EDITITEM . "' /></a>  ";
    echo "\n  <tr>\n    <td class='{$oddeven}'><input type='checkbox' name='ids[]' value='{$lid}' /></td>\n    <td class='{$oddeven}'>{$editbutton}</td>\n    <td class='{$oddeven}'>" . $xoopsUser->getUnameFromId($submitter) . "</td>\n    <td class='{$oddeven}'><a href='{$photos_url}/{$lid}.{$ext}' target='_blank'>{$title}</a></td>\n    <td class='{$oddeven}' width='100%'>{$description}</td>\n    <td class='{$oddeven}'>{$cat}</td>\n  </tr>\n";
}
echo "\n  <tr>\n    <!-- <td colspan='4' align='left'>" . _MD_A_GNAVI_LABEL_ADMIT . "<input type='submit' name='admit' value='" . _MD_A_GNAVI_BUTTON_ADMIT . "' /></td> -->\n    <td colspan='8' align='left'>" . _MD_A_GNAVI_LABEL_ADMIT . "<input type='button' value='" . _MD_A_GNAVI_BUTTON_ADMIT . "' onclick='document.MainForm.action.value=\"admit\"; submit();' /></td>\n  </tr>\n  <tr>\n    <td colspan='8' align='left'>" . _MD_A_GNAVI_LABEL_REMOVE . "<input type='button' value='" . _MD_A_GNAVI_BUTTON_REMOVE . "' onclick='if(confirm(\"" . _MD_A_GNAVI_JS_REMOVECONFIRM . "\")){document.MainForm.action.value=\"delete\"; submit();}' /></td>\n  </tr>\n</table>\n</form>\n</td></tr></table>\n";
xoops_cp_footer();
示例#9
0
    $xoopsTpl->assign('columns', $columns);
}
$xoopsTpl->assign('advertisement', news_getmoduleoption('advertisement'));
/**
 * Create the Meta Datas
 */
news_CreateMetaDatas();
/**
 * Create a clickable path from the root to the current topic (if we are viewing a topic)
 * Actually this is not used in the default templates but you can use it as you want
 * You can comment the code to optimize the requests count
 */
if ($xoopsOption['storytopic']) {
    include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
    $mytree = new XoopsTree($xoopsDB->prefix('topics'), 'topic_id', 'topic_pid');
    $topicpath = $mytree->getNicePathFromId($xoopsOption['storytopic'], 'topic_title', 'index.php?op=1');
    $xoopsTpl->assign('topic_path', $topicpath);
    unset($mytree);
}
/**
 * Create a link for the RSS feed (if the module's option is activated)
 */
if ($xoopsModuleConfig['topicsrss'] && $xoopsOption['storytopic']) {
    $link = sprintf("<a href='%s' title='%s'><img src='%s' border='0' alt='%s'></a>", XOOPS_URL . '/modules/news/backendt.php?topicid=' . $xoopsOption['storytopic'], _NW_RSSFEED, XOOPS_URL . '/modules/news/images/rss.gif', _NW_RSSFEED);
    $xoopsTpl->assign('topic_rssfeed_link', $link);
}
/**
 * Assign page's title
 */
if ($firsttitle != '') {
    $xoopsTpl->assign('xoops_pagetitle', $firsttitle . ' - ' . $xoopsModule->name('s'));
示例#10
0
    $xoopsTpl->assign('attached_files', $newsfiles);
}
/**
 * Create page's title
*/
$xoopsTpl->assign('xoops_pagetitle', $article->title() . ' - ' . $article->topic_title() . ' - ' . $myts->htmlSpecialChars($xoopsModule->name()));
if (getmoduleoption('newsbythisauthor')) {
    $xoopsTpl->assign('news_by_the_same_author_link', sprintf("<a href='%s?uid=%d'>%s</a>", XOOPS_URL . '/modules/news/newsbythisauthor.php', $article->uid(), _NW_NEWSSAMEAUTHORLINK));
}
/**
 * Create a clickable path from the root to the current topic (if we are viewing a topic)
 * Actually this is not used in the default's templates but you can use it as you want
 * Uncomment the code to be able to use it
 */
$mytree = new XoopsTree($xoopsDB->prefix("topics"), "topic_id", "topic_pid");
$topicpath = $mytree->getNicePathFromId($article->topicid(), "topic_title", "index.php?op=1");
$xoopsTpl->assign('topic_path', $topicpath);
unset($mytree);
/**
 * Summary table
 *
 * When you are viewing an article, you can see a summary table containing
 * the first n links to the last published news.
 * This summary table is visible according to a module's option (showsummarytable)
 * The number of items is equal to the module's option "storyhome" ("Select the number
 * of news items to display on top page")
 * We also use the module's option "restrictindex" ("Restrict Topics on Index Page"), like
 * this you (the webmaster) select if users can see restricted stories or not.
 */
if (getmoduleoption('showsummarytable')) {
    $xoopsTpl->assign('showsummary', true);
示例#11
0
 /**
  * @param $funcURL
  *
  * @return string
  */
 public function getNiceTopicPathFromId($funcURL)
 {
     $xt = new XoopsTree($this->table, 'topic_id', 'topic_pid');
     $ret = $xt->getNicePathFromId($this->topic_id, 'topic_title', $funcURL);
     return $ret;
 }
示例#12
0
        $whr .= "AND (CONCAT( l.title , l.ext , c.title ) LIKE '%" . addslashes($keyword) . "%') ";
    }
}
// query for listing
$rs = $xoopsDB->query("SELECT count(l.lid) FROM {$table_photos} l LEFT JOIN {$table_cat} c ON l.cid=c.cid WHERE {$whr}");
list($numrows) = $xoopsDB->fetchRow($rs);
$prs = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.submitter, l.ext, t.description FROM {$table_photos} l LEFT JOIN {$table_cat} c ON l.cid=c.cid LEFT JOIN {$table_text} t ON l.lid=t.lid WHERE {$whr} ORDER BY l.lid DESC LIMIT {$pos},{$num}");
// Page Navigation
$nav = new XoopsPageNav($numrows, $num, $pos, 'pos', "num={$num}&txt=" . urlencode($txt));
$nav_html = $nav->renderNav(10);
// beggining of Output
xoops_cp_header();
include './mymenu.php';
// check $xoopsModule
if (!is_object($xoopsModule)) {
    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
}
echo "<h3 style='text-align:left;'>" . sprintf(_AM_H3_FMT_ADMISSION, $xoopsModule->name()) . "</h3>\n";
echo "\r\n<p><font color='blue'>" . (isset($_GET['mes']) ? $_GET['mes'] : "") . "</font></p>\r\n<table width='95%' border='0' cellpadding='4' cellspacing='0'><tr><td>\r\n<form action='' method='GET' style='margin-bottom:0px;text-align:right'>\r\n  <input type='hidden' name='num' value='{$num}'>\r\n  <input type='text' name='txt' value='" . htmlspecialchars($txt, ENT_QUOTES) . "'>\r\n  <input type='submit' value='" . _ALBM_AM_BUTTON_EXTRACT . "' /> &nbsp; \r\n  {$nav_html} &nbsp; \r\n</form>\r\n<form name='MainForm' action='' method='POST' style='margin-top:0px;'>\r\n<input type='hidden' name='action' value='' />\r\n<table width='95%' class='outer' cellpadding='4' cellspacing='1'>\r\n  <tr valign='middle'>\r\n    <th width='5'><input type='checkbox' name='dummy' onclick=\"with(document.MainForm){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=this.checked;}}}\" /></th>\r\n    <th></th>\r\n    <th>" . _AM_TH_SUBMITTER . "</th>\r\n    <th>" . _AM_TH_TITLE . "</th>\r\n    <th>" . _AM_TH_DESCRIPTION . "</th>\r\n    <th>" . _AM_TH_CATEGORIES . "</th>\r\n  </tr>\r\n";
// Listing
$oddeven = 'odd';
while (list($lid, $cid, $title, $submitter, $ext, $description) = $xoopsDB->fetchRow($prs)) {
    $oddeven = $oddeven == 'odd' ? 'even' : 'odd';
    $title = $myts->makeTboxData4Show($title);
    $description = $myts->displayTarea($description, 0, 1, 1, 1, 1, 1);
    $cat = $cattree->getNicePathFromId($cid, "title", "../viewcat.php?");
    $editbutton = "<a href='" . XOOPS_URL . "/modules/{$mydirname}/editphoto.php?lid={$lid}' target='_blank'><img src='" . XOOPS_URL . "/modules/{$mydirname}/images/editicon.gif' border='0' alt='" . _ALBM_EDITTHISPHOTO . "' title='" . _ALBM_EDITTHISPHOTO . "' /></a>  ";
    echo "\r\n  <tr>\r\n    <td class='{$oddeven}'><input type='checkbox' name='ids[]' value='{$lid}' /></td>\r\n    <td class='{$oddeven}'>{$editbutton}</td>\r\n    <td class='{$oddeven}'>" . $xoopsUser->getUnameFromId($submitter) . "</td>\r\n    <td class='{$oddeven}'><a href='{$photos_url}/{$lid}.{$ext}' target='_blank'>{$title}</a></td>\r\n    <td class='{$oddeven}' width='100%'>{$description}</td>\r\n    <td class='{$oddeven}'>{$cat}</td>\r\n  </tr>\n";
}
echo "\r\n  <tr>\r\n    <!-- <td colspan='4' align='left'>" . _ALBM_AM_LABEL_ADMIT . "<input type='submit' name='admit' value='" . _ALBM_AM_BUTTON_ADMIT . "' /></td> -->\r\n    <td colspan='8' align='left'>" . _ALBM_AM_LABEL_ADMIT . "<input type='button' value='" . _ALBM_AM_BUTTON_ADMIT . "' onclick='document.MainForm.action.value=\"admit\"; submit();' /></td>\r\n  </tr>\r\n  <tr>\r\n    <td colspan='8' align='left'>" . _ALBM_AM_LABEL_REMOVE . "<input type='button' value='" . _ALBM_AM_BUTTON_REMOVE . "' onclick='if(confirm(\"" . _ALBM_AM_JS_REMOVECONFIRM . "\")){document.MainForm.action.value=\"delete\"; submit();}' /></td>\r\n  </tr>\r\n</table>\r\n</form>\r\n</td></tr></table>\r\n";
xoops_cp_footer();