コード例 #1
0
ファイル: index.php プロジェクト: severnaya99/Sg-2010
         $sfiles = new sFiles();
         $filesarr = array();
         $filesarr = $sfiles->getAllbyStory($storyid);
         if (count($filesarr) > 0) {
             foreach ($filesarr as $onefile) {
                 $onefile->delete();
             }
         }
         xoops_comment_delete($xoopsModule->getVar('mid'), $storyid);
         xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'story', $storyid);
         redirect_header('index.php?op=newarticle', 1, _AMS_AM_DBUPDATED);
         exit;
     } else {
         $story = new AmsStory($storyid);
         echo "<h4>" . _AMS_AM_CONFIG . "</h4>";
         xoops_confirm(array('op' => 'delete', 'storyid' => $storyid, 'ok' => 1), 'index.php', _AMS_AM_RUSUREDEL . '<br />' . $story->title());
     }
     break;
 case "default":
 default:
 case "topicsmanager":
     adminmenu(1);
     topicsmanager();
     break;
 case "addTopic":
     addTopic();
     break;
 case "delTopic":
     delTopic();
     break;
 case "modTopicS":
コード例 #2
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';
}
コード例 #3
0
ファイル: link.php プロジェクト: severnaya99/Sg-2010
        }
        break;
    case 'dellink':
        if (isset($_POST['linkids'])) {
            $errors = 0;
            foreach ($_POST['linkids'] as $linkid) {
                if (!$article->deleteLink($linkid)) {
                    $errors = 1;
                }
            }
            if ($errors == 1) {
                $xoopsTpl->assign('message', $article->renderErrors());
            }
        } else {
            $xoopsTpl->assign('message', "No link selected");
        }
        break;
}
$existing_links = $article->getLinks();
include 'include/searchform.php';
$search_form->assign($xoopsTpl);
if (count($existing_links) > 0) {
    $xoopsTpl->assign('related', $existing_links);
}
$xoopsTpl->assign('breadcrumb', $article->getPath(true) . " > " . _AMS_NW_MANAGELINK);
$xoopsTpl->assign('story', $article->toArray());
$xoopsTpl->assign('lang_on', _ON);
$xoopsTpl->assign('lang_postedby', _POSTEDBY);
$xoopsTpl->assign('lang_reads', _READS);
$xoopsTpl->assign('xoops_pagetitle', $myts->htmlSpecialChars($xoopsModule->name()) . ' - ' . $myts->htmlSpecialChars($article->title()));
include XOOPS_ROOT_PATH . '/footer.php';
コード例 #4
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";
コード例 #5
0
ファイル: submit.php プロジェクト: severnaya99/Sg-2010
     $approve = 1;
     $story->setPublished(time());
     $story->setExpired(0);
     $story->setTopicalign('R');
 } else {
     $story->setPublished(0);
     $approve = 0;
     $story->setExpired(0);
 }
 $story->setApproved($approve);
 $result = $story->store();
 if ($result) {
     // Notification
     $notification_handler =& xoops_gethandler('notification');
     $tags = array();
     $tags['STORY_NAME'] = $story->title();
     $tags['STORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?storyid=' . $story->storyid();
     if ($approve == 1 && $oldapprove == 0 && $story->published <= time()) {
         $notification_handler->triggerEvent('global', 0, 'new_story', $tags);
     } elseif ($approve != 1) {
         $tags['WAITINGSTORIES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?op=edit&amp;storyid=' . $story->storyid();
         $notification_handler->triggerEvent('global', 0, 'story_submit', $tags);
         // If notify checkbox is set, add subscription for approve
         if ($notifypub) {
             include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
             $notification_handler->subscribe('story', $story->storyid(), 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
         }
     }
     // Manage upload(s)
     if (isset($_POST['delupload']) && count($_POST['delupload']) > 0) {
         foreach ($_POST['delupload'] as $onefile) {
コード例 #6
0
ファイル: showversion.php プロジェクト: severnaya99/Sg-2010
} else {
    $groups = XOOPS_GROUP_ANONYMOUS;
}
if (!$gperm_handler->checkRight("ams_approve", $article->topicid(), $groups, $xoopsModule->getVar('mid'))) {
    redirect_header(XOOPS_URL . '/modules/AMS/index.php', 3, _NOPERM);
    exit;
}
$xoopsOption['template_main'] = 'ams_article.html';
include_once XOOPS_ROOT_PATH . '/header.php';
$xoopsTpl->assign('story', $article->toArray(true, false, -1));
$banner = $myts->displayTarea($article->getBanner(), 1);
if (!$banner || $banner == "") {
    $banner = " ";
}
$xoopsTpl->assign('articlebanner', $banner);
if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) {
    $showcomments = 1;
} else {
    $showcomments = 0;
}
$xoopsTpl->assign('showcomments', $showcomments);
$xoopsTpl->assign('lang_printerpage', _AMS_NW_PRINTERFRIENDLY);
$xoopsTpl->assign('lang_sendstory', _AMS_NW_SENDSTORY);
$xoopsTpl->assign('lang_on', _ON);
$xoopsTpl->assign('lang_postedby', _POSTEDBY);
$xoopsTpl->assign('lang_reads', _READS);
$xoopsTpl->assign('showfull', true);
$xoopsTpl->assign('admin', false);
$xoopsTpl->assign('xoops_sitename', $myts->htmlSpecialChars($article->title()));
$xoopsTpl->assign('xoops_pagetitle', " v." . $article->version());
include_once XOOPS_ROOT_PATH . '/footer.php';