예제 #1
0
 public static function newInstance()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }
예제 #2
0
 public function setShout($desc, $link = null)
 {
     $s = new Shoutbox();
     $s->setAuthor(sfContext::getInstance()->getUser()->getAttribute("id"));
     if (is_array($desc)) {
         $s->setSystem(1);
         $s->setDescription(json_encode($desc));
         $s->setLink($link);
     } else {
         $s->setSystem(0);
         $s->setDescription($desc);
     }
     $s->save();
     return $s;
 }
예제 #3
0
 /**
  * display_home
  * This display the module in home page
  */
 public function display_home()
 {
     if (AmpConfig::get('sociable')) {
         echo "<div id='shout_objects'>\n";
         $shouts = Shoutbox::get_top($this->maxitems);
         if (count($shouts)) {
             require_once AmpConfig::get('prefix') . UI::find_template('show_shoutbox.inc.php');
         }
         echo "</div>\n";
     }
 }
예제 #4
0
function dispMenu($intSectionNum)
{
    global $MAIN_ROOT, $LOGGED_IN, $mysqli, $shoutBoxPostLink, $shoutBoxDeleteLink, $shoutBoxEditLink, $arrShoutBoxIDs, $websiteInfo, $arrLoginInfo;
    echo "<div id='menuSection_" . $intSectionNum . "'>";
    $menuCatObj = new MenuCategory($mysqli);
    $menuItemObj = new MenuItem($mysqli);
    $customPageObj = new Basic($mysqli, "custompages", "custompage_id");
    $customFormObj = new CustomForm($mysqli);
    $downloadCatObj = new Basic($mysqli, "downloadcategory", "downloadcategory_id");
    $memberObj = new Member($mysqli);
    $pollObj = new Poll($mysqli);
    if ($LOGGED_IN) {
        $intMenuAccessType = 1;
    } else {
        $intMenuAccessType = 2;
    }
    $arrMenuCategories = $menuCatObj->getCategories($intSectionNum, $intMenuAccessType);
    foreach ($arrMenuCategories as $menuCatID) {
        $menuCatObj->select($menuCatID);
        $menuCatInfo = $menuCatObj->get_info();
        $arrMenuItems = $menuItemObj->getItems($menuCatInfo['menucategory_id'], $intMenuAccessType);
        if ($menuCatInfo['headertype'] == "image") {
            echo "<img src='" . $MAIN_ROOT . $menuCatInfo['headercode'] . "' class='menuHeaderImg'><br>";
        } else {
            $menuCatInfo['headercode'] = str_replace("[MAIN_ROOT]", $MAIN_ROOT, $menuCatInfo['headercode']);
            $menuCatInfo['headercode'] = str_replace("[MEMBER_ID]", $arrLoginInfo['memberID'], $menuCatInfo['headercode']);
            $menuCatInfo['headercode'] = str_replace("[MEMBERUSERNAME]", $arrLoginInfo['memberUsername'], $menuCatInfo['headercode']);
            $menuCatInfo['headercode'] = str_replace("[MEMBERRANK]", $arrLoginInfo['memberRank'], $menuCatInfo['headercode']);
            $menuCatInfo['headercode'] = str_replace("[PMLINK]", $arrLoginInfo['pmLink'], $menuCatInfo['headercode']);
            echo $menuCatInfo['headercode'];
        }
        foreach ($arrMenuItems as $menuItemID) {
            $menuItemObj->select($menuItemID);
            $menuItemInfo = $menuItemObj->get_info();
            $menuItemInfo['itemtype'] = $menuItemInfo['itemtype'] == "customcode" || $menuItemInfo['itemtype'] == "customformat" ? "customblock" : $menuItemInfo['itemtype'];
            switch ($menuItemInfo['itemtype']) {
                case "link":
                    $menuItemObj->objLink->select($menuItemInfo['itemtype_id']);
                    $menuLinkInfo = $menuItemObj->objLink->get_info();
                    $checkURL = parse_url($menuLinkInfo['link']);
                    if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) {
                        $menuLinkInfo['link'] = $MAIN_ROOT . $menuLinkInfo['link'];
                    }
                    echo "<div style='text-align: " . $menuLinkInfo['textalign'] . "'>&nbsp;&nbsp;" . $menuLinkInfo['prefix'] . "<a href='" . $menuLinkInfo['link'] . "' target='" . $menuLinkInfo['linktarget'] . "'>" . $menuItemInfo['name'] . "</a></div>";
                    break;
                case "top-players":
                    $dispTopPlayers = unserialize(SPECIAL_MENU_ITEM);
                    echo $dispTopPlayers['top-players'];
                    break;
                case "customform":
                    $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']);
                    $menuCustomFormInfo = $menuItemObj->objCustomPage->get_info();
                    $customFormObj->select($menuCustomFormInfo['custompage_id']);
                    echo "<div style='text-align: " . $menuCustomFormInfo['textalign'] . "'>&nbsp;&nbsp;" . $menuCustomFormInfo['prefix'] . "<a href='" . $MAIN_ROOT . "customform.php?pID=" . $menuCustomFormInfo['custompage_id'] . "' target='" . $menuCustomFormInfo['linktarget'] . "'>" . $customFormObj->get_info_filtered("name") . "</a></div>";
                    break;
                case "custompage":
                    $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']);
                    $menuCustomPageInfo = $menuItemObj->objCustomPage->get_info();
                    $customPageObj->select($menuCustomPageInfo['custompage_id']);
                    echo "<div style='text-align: " . $menuCustomPageInfo['textalign'] . "'>&nbsp;&nbsp;" . $menuCustomPageInfo['prefix'] . "<a href='" . $MAIN_ROOT . "custompage.php?pID=" . $menuCustomPageInfo['custompage_id'] . "' target='" . $menuCustomPageInfo['linktarget'] . "'>" . $customPageObj->get_info_filtered("pagename") . "</a></div>";
                    break;
                case "downloads":
                    $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']);
                    $menuDownloadLinkInfo = $menuItemObj->objCustomPage->get_info();
                    $downloadCatObj->select($menuDownloadLinkInfo['custompage_id']);
                    echo "<div style='text-align: " . $menuDownloadLinkInfo['textalign'] . "'>&nbsp;&nbsp;" . $menuDownloadLinkInfo['prefix'] . "<a href='" . $MAIN_ROOT . "downloads/index.php?catID=" . $menuDownloadLinkInfo['custompage_id'] . "' target='" . $menuDownloadLinkInfo['linktarget'] . "'>" . $downloadCatObj->get_info_filtered("name") . "</a></div>";
                    break;
                case "customblock":
                    $menuItemObj->objCustomBlock->select($menuItemInfo['itemtype_id']);
                    $menuCustomBlockInfo = $menuItemObj->objCustomBlock->get_info();
                    $menuCustomBlockInfo['code'] = str_replace("[MAIN_ROOT]", $MAIN_ROOT, $menuCustomBlockInfo['code']);
                    $menuCustomBlockInfo['code'] = str_replace("[MEMBER_ID]", $arrLoginInfo['memberID'], $menuCustomBlockInfo['code']);
                    $menuCustomBlockInfo['code'] = str_replace("[MEMBERUSERNAME]", $arrLoginInfo['memberUsername'], $menuCustomBlockInfo['code']);
                    $menuCustomBlockInfo['code'] = str_replace("[MEMBERRANK]", $arrLoginInfo['memberRank'], $menuCustomBlockInfo['code']);
                    $menuCustomBlockInfo['code'] = str_replace("[PMLINK]", $arrLoginInfo['pmLink'], $menuCustomBlockInfo['code']);
                    echo $menuCustomBlockInfo['code'];
                    break;
                case "image":
                    $menuItemObj->objImage->select($menuItemInfo['itemtype_id']);
                    $menuImageInfo = $menuItemObj->objImage->get_info();
                    $checkURL = parse_url($menuItemInfo['imageurl']);
                    if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) {
                        $menuImageInfo['imageurl'] = $MAIN_ROOT . $menuImageInfo['imageurl'];
                    }
                    $dispSetWidth = "";
                    if ($menuImageInfo['width'] != 0) {
                        $dispSetWidth = "width: " . $menuImageInfo['width'] . "px; ";
                    }
                    $dispSetHeight = "";
                    if ($menuImageInfo['height'] != 0) {
                        $dispSetHeight = "height: " . $menuImageInfo['height'] . "px; ";
                    }
                    echo "<div style='text-align: " . $menuImageInfo['imagealign'] . "; margin-top: 15px; margin-bottom: 15px'>";
                    if ($menuImageInfo['link'] != "") {
                        $checkURL = parse_url($menuImageInfo['link']);
                        if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) {
                            $menuImageInfo['link'] = $MAIN_ROOT . $menuImageInfo['link'];
                        }
                        echo "<a href='" . $menuImageInfo['link'] . "' target='" . $menuImageInfo['linktarget'] . "'><img src='" . $menuImageInfo['imageurl'] . "' style='" . $dispSetWidth . $dispSetHeight . "' title='" . $menuItemInfo['name'] . "'></a>";
                    } else {
                        echo "<img src='" . $menuImageInfo['imageurl'] . "' title='" . $menuItemInfo['name'] . "' style='" . $dispSetWidth . $dispSetHeight . "'>";
                    }
                    echo "</div>";
                    break;
                case "shoutbox":
                    $menuItemObj->objShoutbox->select($menuItemInfo['itemtype_id']);
                    $menuShoutboxInfo = $menuItemObj->objShoutbox->get_info();
                    if ($menuShoutboxInfo['width'] == 0) {
                        $menuShoutboxInfo['width'] = "145";
                    }
                    $blnShoutboxWidthPercent = false;
                    if ($menuShoutboxInfo['percentwidth'] == 1) {
                        $blnShoutboxWidthPercent = true;
                    }
                    if ($menuShoutboxInfo['height'] == 0) {
                        $menuShoutboxInfo['height'] = "300";
                    }
                    $blnShoutboxHeightPercent = false;
                    if ($menuShoutboxInfo['percentheight'] == 1) {
                        $blnShoutboxHeightPercent = true;
                    }
                    $mainShoutboxObj = new Shoutbox($mysqli, "news", "news_id");
                    $newShoutBoxID = uniqid("mainShoutBox_");
                    $arrShoutBoxIDs[] = $newShoutBoxID;
                    $mainShoutboxObj->strDivID = $newShoutBoxID;
                    $mainShoutboxObj->intDispWidth = $setShoutBoxWidth;
                    $mainShoutboxObj->intDispHeight = $setShoutBoxHeight;
                    $mainShoutboxObj->strEditLink = $shoutBoxEditLink;
                    $mainShoutboxObj->strDeleteLink = $shoutBoxDeleteLink;
                    $mainShoutboxObj->strPostLink = $shoutBoxPostLink;
                    echo $mainShoutboxObj->dispShoutbox($menuShoutboxInfo['width'], $menuShoutboxInfo['height'], $blnShoutboxWidthPercent, $menuShoutboxInfo['textboxwidth'], $blnShoutboxHeightPercent);
                    echo "\n\t\t\t\t\t\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\t\t\$('#" . $newShoutBoxID . "').animate({\n\t\t\t\t\t\t\t\t\t\tscrollTop:\$('#" . $newShoutBoxID . "')[0].scrollHeight\n\t\t\t\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$('#" . $newShoutBoxID . "_message').keypress(function(eventObj) {\n\t\t\t\t\t\t\t\t\tif(eventObj.which == 13) {\n\t\t\t\t\t\t\t\t\t\tif(\$('#" . $newShoutBoxID . "_message').val() != \"\") {\n\t\t\t\t\t\t\t\t\t\t\t\$('#" . $newShoutBoxID . "_postShoutbox input[type=button]').click();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\n\t\t\t\t\t";
                    break;
                case "newestmembers":
                    $dispNewMembers = unserialize(SPECIAL_MENU_ITEM);
                    echo $dispNewMembers['newmembers'];
                    break;
                case "forumactivity":
                    $dispNewMembers = unserialize(SPECIAL_MENU_ITEM);
                    echo $dispNewMembers['forumactivity'];
                    break;
                case "login":
                    echo constant("LOGIN_BOX");
                    break;
                case "poll":
                    $pollObj->select($menuItemInfo['itemtype_id']);
                    $memberObj->select($_SESSION['btUsername']);
                    $pollObj->dispPollMenu($memberObj);
                    break;
            }
        }
        echo "<br>";
    }
    echo "</div>";
}
예제 #5
0
 public function remove_from_disk()
 {
     $deleted = true;
     $season_ids = $this->get_seasons();
     foreach ($season_ids as $id) {
         $season = new TVShow_Season($id);
         $deleted = $season->remove_from_disk();
         if (!$deleted) {
             debug_event('tvshow', 'Error when deleting the season `' . $id . '`.', 1);
             break;
         }
     }
     if ($deleted) {
         $sql = "DELETE FROM `tvshow` WHERE `id` = ?";
         $deleted = Dba::write($sql, array($this->id));
         if ($deleted) {
             Art::gc('tvshow', $this->id);
             Userflag::gc('tvshow', $this->id);
             Rating::gc('tvshow', $this->id);
             Shoutbox::gc('tvshow', $this->id);
             Useractivity::gc('tvshow', $this->id);
         }
     }
     return $deleted;
 }
예제 #6
0
 public function get_display($details = true, $jsbuttons = false)
 {
     $object = Shoutbox::get_object($this->object_type, $this->object_id);
     $object->format();
     $img = $this->get_image();
     $html = "<div class='shoutbox-item'>";
     $html .= "<div class='shoutbox-data'>";
     if ($details && $img) {
         $html .= "<div class='shoutbox-img'>" . $img . "</div>";
     }
     $html .= "<div class='shoutbox-info'>";
     if ($details) {
         $html .= "<div class='shoutbox-object'>" . $object->f_link . "</div>";
         $html .= "<div class='shoutbox-date'>" . date("Y/m/d H:i:s", $this->date) . "</div>";
     }
     $html .= "<div class='shoutbox-text'>" . $this->f_text . "</div>";
     $html .= "</div>";
     $html .= "</div>";
     $html .= "<div class='shoutbox-footer'>";
     if ($details) {
         $html .= "<div class='shoutbox-actions'>";
         if ($jsbuttons) {
             $html .= Ajax::button('?page=stream&action=directplay&playtype=' . $this->object_type . '&' . $this->object_type . '_id=' . $this->object_id, 'play', T_('Play'), 'play_' . $this->object_type . '_' . $this->object_id);
             $html .= Ajax::button('?action=basket&type=' . $this->object_type . '&id=' . $this->object_id, 'add', T_('Add'), 'add_' . $this->object_type . '_' . $this->object_id);
         }
         if (Access::check('interface', '25')) {
             $html .= "<a href=\"" . AmpConfig::get('web_path') . "/shout.php?action=show_add_shout&type=" . $this->object_type . "&id=" . $this->object_id . "\">" . UI::get_icon('comment', T_('Post Shout')) . "</a>";
         }
         $html .= "</div>";
     }
     $html .= "<div class='shoutbox-user'>" . T_('by') . " ";
     if ($this->user > 0) {
         $user = new User($this->user);
         $user->format();
         if ($details) {
             $html .= $user->f_link;
         } else {
             $html .= $user->username;
         }
     } else {
         $html .= T_('Guest');
     }
     $html .= "</div>";
     $html .= "</div>";
     $html .= "</div>";
     return $html;
 }
예제 #7
0
 /**
  * load_latest_shout
  * This loads in the latest added shouts
  * @return array
  */
 public static function load_latest_shout()
 {
     $ids = Shoutbox::get_top(10);
     $results = array();
     foreach ($ids as $id) {
         $shout = new Shoutbox($id);
         $shout->format();
         $object = Shoutbox::get_object($shout->object_type, $shout->object_id);
         $object->format();
         $user = new User($shout->user);
         $user->format();
         $xml_array = array('title' => $user->username . ' ' . T_('on') . ' ' . $object->get_fullname(), 'link' => $object->link, 'description' => $shout->text, 'image' => Art::url($shout->object_id, $shout->object_type, null, 2), 'comments' => '', 'pubDate' => date("c", $shout->date));
         $results[] = $xml_array;
     }
     // end foreach
     return $results;
 }
예제 #8
0
 /**
  * gc
  *
  * This is a wrapper function for all of the different cleaning
  * functions, it runs them in an order that resembles correctness.
  */
 public static function gc()
 {
     debug_event('catalog', 'Database cleanup started', 5);
     Song::gc();
     Album::gc();
     Artist::gc();
     Art::gc();
     Stats::gc();
     Rating::gc();
     Userflag::gc();
     Playlist::gc();
     Tmp_Playlist::gc();
     Shoutbox::gc();
     Tag::gc();
     debug_event('catalog', 'Database cleanup ended', 5);
 }
예제 #9
0
?>
" />
        <input type="hidden" name="data" value="<?php 
echo $data;
?>
" />
        <input type="submit" value="<?php 
echo T_('Create');
?>
" />
    </td>
</tr>
</table>
</form>
<?php 
UI::show_box_bottom();
?>
</div>
<div style="display: inline;">
<?php 
$boxtitle = $object->f_title . ' ' . T_('Shoutbox');
UI::show_box_top($boxtitle, 'box box_add_shout');
$shouts = Shoutbox::get_shouts($object_type, $object->id);
if (count($shouts)) {
    require_once AmpConfig::get('prefix') . '/templates/show_shoutbox.inc.php';
}
UI::show_box_bottom();
?>
</div>
</div>
예제 #10
0
 public function displayShoutbox()
 {
     $shoutboxInfo = $this->menuItemObj->objShoutbox->get_info();
     $shoutboxInfo['width'] = $shoutboxInfo['width'] <= 0 ? $this->defaultShoutboxWidth : $shoutboxInfo['width'];
     $blnShoutboxWidthPercent = $shoutboxInfo['percentwidth'] ? true : false;
     $shoutboxInfo['height'] = $shoutboxInfo['height'] <= 0 ? $this->defaultShoutboxHeight : $shoutboxInfo['height'];
     $blnShoutboxHeightPercent = $shoutboxInfo['percentheight'] ? true : false;
     $shoutboxObj = new Shoutbox($this->MySQL, "news", "news_id");
     $newShoutboxID = uniqid("mainShoutBox_");
     $this->data['shoutboxIDs'][] = $newShoutboxID;
     $shoutboxObj->strDivID = $newShoutboxID;
     $this->arrShoutBoxIDs[] = $newShoutboxID;
     $shoutboxObj->prepareLinks($this->memberObj);
     echo $shoutboxObj->dispShoutbox($shoutboxInfo['width'], $shoutboxInfo['height'], $blnShoutboxWidthPercent, $shoutboxInfo['textboxwidth'], $blnShoutboxHeightPercent);
     echo $shoutboxObj->getShoutboxJS();
 }
예제 #11
0
 public function remove_from_disk()
 {
     $deleted = true;
     $song_ids = $this->get_songs();
     foreach ($song_ids as $id) {
         $song = new Song($id);
         $deleted = $song->remove_from_disk();
         if (!$deleted) {
             debug_event('album', 'Error when deleting the song `' . $id . '`.', 1);
             break;
         }
     }
     if ($deleted) {
         $sql = "DELETE FROM `album` WHERE `id` = ?";
         $deleted = Dba::write($sql, array($this->id));
         if ($deleted) {
             Art::gc('album', $this->id);
             Userflag::gc('album', $this->id);
             Rating::gc('album', $this->id);
             Shoutbox::gc('album', $this->id);
             Useractivity::gc('album', $this->id);
         }
     }
     return $deleted;
 }
예제 #12
0
 /**
  * shouts
  *
  * This handles creating an xml document for a shout list
  *
  * @param    int[]    $shouts    Shout identifier list
  * @return    string    return xml
  */
 public static function shouts($shouts)
 {
     $string = "<shouts>\n";
     foreach ($shouts as $shout_id) {
         $shout = new Shoutbox($shout_id);
         $shout->format();
         $user = new User($shout->user);
         $string .= "\t<shout id=\"" . $shout_id . "\">\n" . "\t\t<date>" . $shout->date . "</date>\n" . "\t\t<text><![CDATA[" . $shout->text . "]]></text>\n";
         if ($user->id) {
             $string .= "\t\t<username><![CDATA[" . $user->username . "]]></username>";
         }
         $string .= "\t</shout>n";
     }
     $string .= "</shouts>\n";
     $final = self::_header() . $string . self::_footer();
     return $final;
 }
예제 #13
0
<?php

/**
 * $Header$
 * @package shoutbox
 * @subpackage functions
 */
global $gQueryUser;
/**
 * required setup
 */
include_once SHOUTBOX_PKG_PATH . 'Shoutbox.php';
$gShout = new Shoutbox();
$gBitUser->hasPermission('p_shoutbox_view');
if ($gQueryUser && $gQueryUser->isRegistered()) {
    $shoutUserId = $gQueryUser->mUserId;
    $_template->tpl_vars['moduleTitle'] = new Smarty_variable($gQueryUser->getDisplayName());
} else {
    $_template->tpl_vars['moduleTitle'] = new Smarty_variable(tra('Shoutbox'));
    $shoutUserId = ROOT_USER_ID;
}
$_template->tpl_vars['toUserId'] = new Smarty_variable($shoutUserId);
$shoutFeedback = NULL;
if ($gBitSystem->isPackageActive('shoutbox') && $gBitUser->hasPermission('p_shoutbox_view')) {
    $parsedUrl = parse_url($_SERVER["REQUEST_URI"]);
    if (isset($parsedUrl["query"])) {
        parse_str($parsedUrl["query"], $sht_query);
    }
    $shout_father = $parsedUrl["path"];
    // recreate url parameters and append ? or &amp; that we can add parameters in the tpl
    if (!empty($sht_query)) {
예제 #14
0
?>
</th>
            <th class="cel_date"><?php 
echo T_('Date Added');
?>
</th>
            <th class="cel_action"><?php 
echo T_('Action');
?>
</th>
        </tr>
    </thead>
    <tbody>
        <?php 
foreach ($object_ids as $shout_id) {
    $libitem = new Shoutbox($shout_id);
    $libitem->format();
    $object = Shoutbox::get_object($libitem->object_type, $libitem->object_id);
    $object->format();
    $client = new User($libitem->user);
    $client->format();
    require AmpConfig::get('prefix') . '/templates/show_shout_row.inc.php';
    ?>
        <?php 
}
if (!count($object_ids)) {
    ?>
        <tr class="<?php 
    echo UI::flip_class();
    ?>
">
예제 #15
0
 /**
  * Remove the video from disk.
  */
 public function remove_from_disk()
 {
     if (file_exists($this->file)) {
         $deleted = unlink($this->file);
     } else {
         $deleted = true;
     }
     if ($deleted === true) {
         $sql = "DELETE FROM `video` WHERE `id` = ?";
         $deleted = Dba::write($sql, array($this->id));
         if ($deleted) {
             Art::gc('video', $this->id);
             Userflag::gc('video', $this->id);
             Rating::gc('video', $this->id);
             Shoutbox::gc('video', $this->id);
             Useractivity::gc('video', $this->id);
         }
     } else {
         debug_event('video', 'Cannot delete ' . $this->file . 'file. Please check permissions.', 1);
     }
     return $deleted;
 }
예제 #16
0
    <?php 
    UI::show_box_top(T_('Albums of the Moment'));
    echo T_('Loading...');
    UI::show_box_bottom();
    ?>
</div>
<?php 
}
?>
<!-- Recently Played -->
<div id="recently_played">
    <?php 
$data = Song::get_recently_played();
Song::build_cache(array_keys($data));
require_once AmpConfig::get('prefix') . '/templates/show_recently_played.inc.php';
?>
</div>
<!-- Shoutbox Objects, if shoutbox is enabled -->
<?php 
if (AmpConfig::get('sociable')) {
    ?>
<div id="shout_objects">
    <?php 
    $shouts = Shoutbox::get_top('5');
    if (count($shouts)) {
        require_once AmpConfig::get('prefix') . '/templates/show_shoutbox.inc.php';
    }
    ?>
</div>
<?php 
}
예제 #17
0
 public function remove_from_disk()
 {
     $deleted = true;
     $video_ids = $this->get_episodes();
     foreach ($video_ids as $id) {
         $video = Video::create_from_id($id);
         $deleted = $video->remove_from_disk();
         if (!$deleted) {
             debug_event('tvshow_season', 'Error when deleting the video `' . $id . '`.', 1);
             break;
         }
     }
     if ($deleted) {
         $sql = "DELETE FROM `tvshow_season` WHERE `id` = ?";
         $deleted = Dba::write($sql, array($this->id));
         if ($deleted) {
             Art::gc('tvshow_season', $this->id);
             Userflag::gc('tvshow_season', $this->id);
             Rating::gc('tvshow_season', $this->id);
             Shoutbox::gc('tvshow_season', $this->id);
         }
     }
     return $deleted;
 }
예제 #18
0
        <script src="js/chat.js"></script>
        <script src="js/statut.js"></script>
    </head>
    <body>
        
    	<div id="wrapper">
            <div id="header">
                <?php 
include_once "engine/templates/header.php";
?>
            </div>
            
    		<div id="content">
                    <?php 
include_once 'engine/shoutbox.engine.php';
$shoutbox = new Shoutbox();
$nbshout = $shoutbox->getNbShout();
?>
                    <div class="chat" data-nb="<?php 
echo $nbshout;
?>
">
                        <?php 
echo $shoutbox->getAllShout();
?>
                    </div>
                    <div class="users">
                        <?php 
include_once 'engine/users.engine.php';
$users = new Users();
$users->getAllStatut();
예제 #19
0
 /**
  * gc
  *
  * This is a wrapper function for all of the different cleaning
  * functions, it runs them in an order that resembles correctness.
  */
 public static function gc()
 {
     debug_event('catalog', 'Database cleanup started', 5);
     Song::gc();
     Album::gc();
     Artist::gc();
     Video::gc();
     Art::gc();
     Stats::gc();
     Rating::gc();
     Userflag::gc();
     Useractivity::gc();
     Playlist::gc();
     Tmp_Playlist::gc();
     Shoutbox::gc();
     Tag::gc();
     // TODO: use InnoDB with foreign keys and on delete cascade to get rid of garbage collection
     \Lib\Metadata\Repository\Metadata::gc();
     \Lib\Metadata\Repository\MetadataField::gc();
     debug_event('catalog', 'Database cleanup ended', 5);
 }
예제 #20
0
파일: shout.php 프로젝트: nioc/ampache
switch ($_REQUEST['action']) {
    case 'edit_shout':
        $shout = new Shoutbox($_REQUEST['shout_id']);
        if ($shout->id) {
            $shout->update($_POST);
        }
        show_confirmation(T_('Shoutbox Post Updated'), '', AmpConfig::get('web_path') . '/admin/shout.php');
        break;
    case 'show_edit':
        $shout = new Shoutbox($_REQUEST['shout_id']);
        $object = Shoutbox::get_object($shout->object_type, $shout->object_id);
        $object->format();
        $client = new User($shout->user);
        $client->format();
        require_once AmpConfig::get('prefix') . '/templates/show_edit_shout.inc.php';
        break;
    case 'delete':
        Shoutbox::delete($_REQUEST['shout_id']);
        show_confirmation(T_('Shoutbox Post Deleted'), '', AmpConfig::get('web_path') . '/admin/shout.php');
        break;
    default:
        $browse = new Browse();
        $browse->set_type('shoutbox');
        $browse->set_simple_browse(true);
        $shoutbox_ids = $browse->get_objects();
        $browse->show_objects($shoutbox_ids);
        $browse->store();
        break;
}
// end switch on action
UI::show_footer();
예제 #21
0
    if ($squadObj->select($_GET['sID']) && $squadObj->memberHasAccess($memberInfo['member_id'], "postshoutbox")) {
        $squadInfo = $squadObj->get_info();
        $squadNewsObj = new Basic($mysqli, "squadnews", "squadnews_id");
        $arrColumns = array("member_id", "squad_id", "dateposted", "newspost", "newstype");
        $arrValues = array($memberInfo['member_id'], $squadInfo['squad_id'], time(), $_POST['message'], 3);
        $squadNewsObj->addNew($arrColumns, $arrValues);
        if ($squadObj->memberHasAccess($memberInfo['member_id'], "manageshoutbox")) {
            $blnManageShoutbox = true;
        }
    }
}
$squadMemberList = $squadObj->getMemberList();
$blnShowShoutBox = false;
if (in_array($memberInfo['member_id'], $squadMemberList) && $squadInfo['privateshoutbox'] == 1) {
    $blnShowShoutBox = true;
} elseif ($squadInfo['privateshoutbox'] == 0) {
    $blnShowShoutBox = true;
}
if ($blnShowShoutBox) {
    $shoutboxObj = new Shoutbox($mysqli, "squadnews", "squadnews_id");
    $shoutboxObj->strDivID = "squadsShoutbox";
    $shoutboxObj->intDispWidth = 205;
    $shoutboxObj->intDispHeight = 400;
    $shoutboxObj->blnUpdateShoutbox = true;
    $shoutboxObj->strSQLSort = " AND squad_id ='" . $squadInfo['squad_id'] . "'";
    if ($blnManageShoutbox) {
        $shoutboxObj->strEditLink = $MAIN_ROOT . "members/squads/managesquad.php?&pID=ManageShoutbox&sID=" . $squadInfo['squad_id'] . "&nID=";
        $shoutboxObj->strDeleteLink = $MAIN_ROOT . "members/squads/include/deleteshoutpost.php?sID=" . $squadInfo['squad_id'];
    }
    echo $shoutboxObj->dispShoutbox();
}
예제 #22
0
        <th class="cel_comment"><?php 
echo T_('Comment');
?>
</th>
        <th class="cel_date"><?php 
echo T_('Date Added');
?>
</th>
        <th class="cel_action"><?php 
echo T_('Action');
?>
</th>
    </tr>
    <?php 
foreach ($object_ids as $shout_id) {
    $shout = new Shoutbox($shout_id);
    $shout->format();
    $object = Shoutbox::get_object($shout->object_type, $shout->object_id);
    $object->format();
    $client = new User($shout->user);
    $client->format();
    require AmpConfig::get('prefix') . '/templates/show_shout_row.inc.php';
    ?>
    <?php 
}
if (!count($object_ids)) {
    ?>
    <tr class="<?php 
    echo UI::flip_class();
    ?>
">
예제 #23
0
include "../class.anesthesiologist.php";
include "../class.site.php";
include "../class.kbase.php";
include "../class.nurse.php";
include "../initsession.php";

$db = new MySQLDB;
$conn = $db->connid();
$db->selectdb("openaims");
$referrer = new Referrer;
$anes = new Anes;
$nurse = new Nurse;
$patient = new Patient;
$site = new Site;
$kbase = new Kbase;
$shoutbox = new Shoutbox;

if (!$site->apply_iprestriction($_SERVER["REMOTE_ADDR"],"DSS")) {
    session_destroy();
    header("location: warning.html");
}

?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>Anesthesia DSS Console</title>
<style type="text/css">
<!--
td { font-size: 10pt; font-family: verdana, sans-serif }
small { font-family: verdana, sans serif}
예제 #24
0
파일: api.class.php 프로젝트: nioc/ampache
 /**
  * last_shouts
  * This get the latest posted shouts
  * @param array $input
  */
 public static function last_shouts($input)
 {
     $limit = intval($input['limit']);
     if ($limit < 1) {
         $limit = AmpConfig::get('popular_threshold');
     }
     if (AmpConfig::get('sociable')) {
         $username = $input['username'];
         if (!empty($username)) {
             $shouts = Shoutbox::get_top($limit, $username);
         } else {
             $shouts = Shoutbox::get_top($limit);
         }
         ob_end_clean();
         echo XML_Data::shouts($shouts);
     } else {
         debug_event('api', 'Sociable feature is not enabled.', 3);
     }
 }
예제 #25
0
<?php

// $Header$
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
require_once '../kernel/setup_inc.php';
include_once SHOUTBOX_PKG_PATH . 'Shoutbox.php';
$gShout = new Shoutbox();
$gBitSystem->verifyPackage('shoutbox');
$gBitSystem->verifyPermission('p_shoutbox_view');
$feedback = NULL;
$edit = NULL;
// Permissioning is handled in the class, where it should be...
if (isset($_REQUEST["remove"])) {
    if ($gShout->expunge($_REQUEST["remove"])) {
        $feedback['success'] = tra("Message removed");
    } else {
        $feedback['error'] = $gShout->mErrors['expunge'];
    }
} elseif (isset($_REQUEST["shoutbox_admin"]) && $gBitUser->isAdmin()) {
    $gBitSystem->storeConfig('shoutbox_autolink', isset($_REQUEST["shoutbox_autolink"]) ? $_REQUEST["shoutbox_autolink"] : NULL, SHOUTBOX_PKG_NAME);
    $gBitSystem->storeConfig('shoutbox_email_notice', isset($_REQUEST["shoutbox_email_notice"]) ? 'y' : NULL, SHOUTBOX_PKG_NAME);
    $gBitSystem->storeConfig('shoutbox_smileys', isset($_REQUEST["shoutbox_smileys"]) ? 'y' : NULL, SHOUTBOX_PKG_NAME);
    // to be on the safe side, we will simply nuke the entire shoutbox cache
    $gShout->mCache->expungeCache();
}
if (!empty($_REQUEST["save"]) && $gBitUser->hasPermission('p_shoutbox_post')) {
    if ($gShout->store($_REQUEST)) {
        $feedback['success'] = tra("Message saved");
예제 #26
0
파일: shout.php 프로젝트: axelsimon/ampache
 case 'add_shout':
     // Must be at least a user to do this
     if (!Access::check('interface', '25')) {
         UI::access_denied();
         exit;
     }
     if (!Core::form_verify('add_shout', 'post')) {
         UI::access_denied();
         exit;
     }
     $shout_id = Shoutbox::create($_POST);
     header("Location:" . AmpConfig::get('web_path'));
     break;
 case 'show_add_shout':
     // Get our object first
     $object = Shoutbox::get_object($_REQUEST['type'], $_REQUEST['id']);
     if (!$object || !$object->id) {
         Error::add('general', T_('Invalid Object Selected'));
         Error::display('general');
         break;
     }
     $object->format();
     if (strtolower(get_class($object)) == 'song') {
         $data = $_REQUEST['offset'];
     }
     // Now go ahead and display the page where we let them add a comment etc
     require_once AmpConfig::get('prefix') . '/templates/show_add_shout.inc.php';
     break;
 default:
     header("Location:" . AmpConfig::get('web_path'));
     break;
예제 #27
0
        //Return the new Ajax::button
        $id = 'button_flip_state_' . $song->id;
        $button = $song->enabled ? 'disable' : 'enable';
        $results[$id] = Ajax::button('?page=song&action=flip_state&song_id=' . $song->id, $button, T_(ucfirst($button)), 'flip_state_' . $song->id);
        break;
    case 'shouts':
        ob_start();
        $type = $_REQUEST['object_type'];
        $id = $_REQUEST['object_id'];
        if ($type == "song") {
            $media = new Song($id);
            $shouts = Shoutbox::get_shouts($type, $id);
            echo "<script type='text/javascript'>\r\n";
            echo "shouts = {};\r\n";
            foreach ($shouts as $id) {
                $shout = new Shoutbox($id);
                $shout->format();
                $key = intval($shout->data);
                echo "if (shouts['" . $key . "'] == undefined) { shouts['" . $key . "'] = new Array(); }\r\n";
                echo "shouts['" . $key . "'].push('" . addslashes($shout->get_display(false)) . "');\r\n";
                echo "\$('.waveform-shouts').append('<div style=\\'position:absolute; width: 3px; height: 3px; background-color: #2E2EFE; top: 15px; left: " . ($shout->data / $media->time * 400 - 1) . "px;\\' />');\r\n";
            }
            echo "</script>\r\n";
        }
        $results['shouts_data'] = ob_get_clean();
        break;
    default:
        $results['rfc3514'] = '0x1';
        break;
}
// switch on action;
예제 #28
0
 public function remove()
 {
     $sql = "DELETE FROM `label` WHERE `id` = ?";
     $deleted = Dba::write($sql, array($this->id));
     if ($deleted) {
         Art::gc('label', $this->id);
         Userflag::gc('label', $this->id);
         Rating::gc('label', $this->id);
         Shoutbox::gc('label', $this->id);
         Useractivity::gc('label', $this->id);
     }
     return $deleted;
 }
예제 #29
0
 *
 * 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
UI::show_box_top(T_('Shoutbox'));
?>
<div id="shoutbox">
<?php 
foreach ($shouts as $shout_id) {
    $shout = new Shoutbox($shout_id);
    $shout->format();
    ?>
<div id="shout<?php 
    echo $shout->id;
    ?>
" class="shout <?php 
    echo UI::flip_class();
    ?>
">
    <?php 
    echo $shout->get_display(true, true);
    ?>
</div>
<?php 
}
예제 #30
0
 public function remove_from_disk()
 {
     $deleted = true;
     $album_ids = $this->get_albums();
     foreach ($album_ids as $id) {
         $album = new Album($id);
         $deleted = $album->remove_from_disk();
         if (!$deleted) {
             debug_event('artist', 'Error when deleting the album `' . $id . '`.', 1);
             break;
         }
     }
     if ($deleted) {
         $sql = "DELETE FROM `artist` WHERE `id` = ?";
         $deleted = Dba::write($sql, array($this->id));
         if ($deleted) {
             Art::gc('artist', $this->id);
             Userflag::gc('artist', $this->id);
             Rating::gc('artist', $this->id);
             Shoutbox::gc('artist', $this->id);
         }
     }
     return $deleted;
 }