コード例 #1
0
ファイル: comment_new.php プロジェクト: severnaya99/Sg-2010
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include '../../mainfile.php';
include_once XOOPS_ROOT_PATH . '/modules/AMS/class/class.newsstory.php';
$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0;
if ($com_itemid > 0) {
    $article = new AmsStory($com_itemid);
    $article->uname();
    $com_replytext = _POSTEDBY . '&nbsp;<b>' . $article->uname . '</b>&nbsp;' . _DATE . '&nbsp;<b>' . formatTimestamp($article->published()) . '</b><br /><br />' . $article->hometext();
    $bodytext = $article->bodytext();
    if ($bodytext != '') {
        $com_replytext .= '<br /><br />' . $bodytext . '';
    }
    $com_replytitle = $article->title();
    include XOOPS_ROOT_PATH . '/include/comment_new.php';
}
コード例 #2
0
ファイル: submit.php プロジェクト: severnaya99/Sg-2010
 $nohtml_db = 1;
 if (is_object($xoopsUser)) {
     $uid = $xoopsUser->getVar('uid');
     if ($approveprivilege) {
         $nohtml_db = empty($_POST['nohtml']) ? 0 : 1;
     }
 } else {
     $uid = 0;
 }
 if (empty($_POST['storyid'])) {
     $story = new AmsStory();
     $oldapprove = 0;
     $story->setUid($uid);
 } else {
     $story = new AmsStory($_POST['storyid']);
     $oldapprove = $story->published() > 0 ? 1 : 0;
     $change = isset($_POST['change']) ? $_POST['change'] : 0;
     //If change = auto
     if ($change == 4) {
         if ($hometext != $story->hometext || $bodytext != $story->bodytext || $_POST['newauthor'] && $approveprivilege) {
             $change = 3;
         } else {
             $change = 0;
         }
     }
     $story->setChange($change);
     if ($_POST['newauthor'] && $approveprivilege) {
         $story->setUid($uid);
     }
 }
 $story->banner = isset($_POST['banner']) ? $_POST['banner'] : 0;
コード例 #3
0
ファイル: archive.php プロジェクト: severnaya99/Sg-2010
    $xoopsTpl->assign('currentyear', $fromyear);
    $xoopsTpl->assign('lang_actions', _AMS_NW_ACTIONS);
    $xoopsTpl->assign('lang_date', _AMS_NW_DATE);
    $xoopsTpl->assign('lang_views', _AMS_NW_VIEWS);
    // must adjust the selected time to server timestamp
    $timeoffset = $useroffset - $xoopsConfig['server_TZ'];
    $monthstart = mktime(0 - $timeoffset, 0, 0, $frommonth, 1, $fromyear);
    $monthend = mktime(23 - $timeoffset, 59, 59, $frommonth + 1, 0, $fromyear);
    $monthend = $monthend > time() ? time() : $monthend;
    $sql = "SELECT * FROM " . $xoopsDB->prefix("ams_article") . " WHERE published >= {$monthstart} and published <= {$monthend} ORDER by published DESC";
    $result = $xoopsDB->query($sql);
    $count = 0;
    while ($myrow = $xoopsDB->fetchArray($result)) {
        $article = new AmsStory($myrow);
        $story = array();
        $story['title'] = "<a href='index.php?storytopic=" . $article->topicid() . "'>" . $article->topic_title() . "</a>: <a href='article.php?storyid=" . $article->storyid() . "'>" . $article->title() . "</a>";
        $story['counter'] = $article->counter();
        $story['date'] = formatTimestamp($article->published(), "m", $useroffset);
        $story['print_link'] = 'print.php?storyid=' . $article->storyid();
        $story['mail_link'] = 'mailto:?subject=' . sprintf(_AMS_NW_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_AMS_NW_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $article->storyid();
        $xoopsTpl->append('stories', $story);
        $count++;
    }
    $xoopsTpl->assign('lang_printer', _AMS_NW_PRINTERFRIENDLY);
    $xoopsTpl->assign('lang_sendstory', _AMS_NW_SENDSTORY);
    $xoopsTpl->assign('lang_storytotal', sprintf(_AMS_NW_THEREAREINTOTAL, $count));
} else {
    $xoopsTpl->assign('show_articles', false);
}
$xoopsTpl->assign('lang_newsarchives', _AMS_NW_NEWSARCHIVES);
include XOOPS_ROOT_PATH . "/footer.php";
コード例 #4
0
ファイル: visit.php プロジェクト: severnaya99/Sg-2010
include "../../mainfile.php";
include_once 'class/class.sfiles.php';
include_once 'class/class.newsstory.php';
$myts =& MyTextSanitizer::getInstance();
// MyTextSanitizer object
$fileid = isset($_GET['fileid']) ? intval($_GET['fileid']) : 0;
if (empty($fileid)) {
    redirect_header(XOOPS_URL . "/modules/AMS/index.php", 2, _ERRORS);
    exit;
}
$sfiles = new sFiles($fileid);
// Do we have the right to see the file ?
$article = new AmsStory($sfiles->getStoryid());
// and the news, can we see it ?
if ($article->published() == 0 || $article->published() > time()) {
    redirect_header(XOOPS_URL . '/modules/AMS/index.php', 2, _AMS_NW_NOSTORY);
    exit;
}
/*
*
* Remarks. Save for later if needed. Expired articles still allowed to be read in AMS. Remove this remark if you want to forbid it.
// Expired
if ( $article->expired() != 0 && $article->expired() < time() ) {
    redirect_header(XOOPS_URL.'/modules/AMS/index.php', 2, _AMS_NW_NOSTORY);
    exit();
}
*/
$gperm_handler =& xoops_gethandler('groupperm');
if (is_object($xoopsUser)) {
    $groups = $xoopsUser->getGroups();