function generate_inner_html()
 {
     global $login_uid;
     if (!isset($_GET['gid']) || empty($_GET['gid'])) {
         parent::set_vars();
         $frnd_list = null;
         if (!empty($_GET['view'])) {
             $frnd_list = $this->friend_list;
         }
         $sb_audios = array();
         $new_album = new Album(AUDIO_ALBUM);
         if ($this->album_id) {
             $new_album = new Album();
             $new_album->album_type = AUDIO_ALBUM;
             $new_album->load((int) $this->album_id);
             $audio_data['album_id'] = $new_album->collection_id;
             $audio_data['album_name'] = $new_album->title;
         } else {
             $new_album->collection_id = $this->default_album_id;
             $audio_data['album_id'] = $this->default_album_id;
             $audio_data['album_name'] = $this->default_album_name;
         }
         $audio_ids = $new_album->get_contents_for_collection();
         if (!empty($audio_ids)) {
             $k = 0;
             $ids = array();
             for ($i = 0; $i < count($audio_ids); $i++) {
                 if ($audio_ids[$i]['type'] != 7) {
                     // Type 7 is for SB Content
                     $ids[$i] = $audio_ids[$i]['content_id'];
                 } else {
                     $tags = Tag::load_tags_for_content($audio_ids[$i]['content_id']);
                     $tags = show_tags($tags, null);
                     //show_tags function is defined in uihelper.php
                     $sb_audios[] = array('content_id' => $audio_ids[$i]['content_id'], 'title' => $audio_ids[$i]['title'], 'type' => $audio_ids[$i]['type'], 'created' => $audio_ids[$i]['created'], 'tags' => $tags);
                 }
             }
             $new_audio = new Audio();
             $data = $new_audio->load_many($ids, $this->uid, $login_uid);
             if (count($data) > 0) {
                 foreach ($data as $d) {
                     $audio_data[$k]['content_id'] = $d['content_id'];
                     $audio_data[$k]['audio_file'] = $d['audio_file'];
                     $audio_data[$k]['audio_caption'] = $d['audio_caption'];
                     $audio_data[$k]['title'] = $d['title'];
                     $audio_data[$k]['body'] = $d['body'];
                     $audio_data[$k]['created'] = $d['created'];
                     $audio_data[$k]['tags'] = $d['tags'];
                     $audio_data[$k]['type'] = "";
                     $k++;
                 }
             }
             // Merging Media Gallery content and SB Content
             for ($counter = 0; $counter < count($sb_audios); $counter++) {
                 $audio_data[$k]['content_id'] = $sb_audios[$counter]['content_id'];
                 $audio_data[$k]['title'] = $sb_audios[$counter]['title'];
                 $audio_data[$k]['type'] = $sb_audios[$counter]['type'];
                 $audio_data[$k]['image_caption'] = $sb_audios[$counter]['title'];
                 $audio_data[$k]['created'] = $sb_audios[$counter]['created'];
                 $audio_data[$k]['tags'] = $sb_audios[$counter]['tags'];
                 $k++;
             }
         }
         if (!empty($_GET['view'])) {
             if (empty($frnd_list)) {
                 $audio_data = NULL;
             }
         }
         $inner_template = NULL;
         switch ($this->mode) {
             default:
                 $inner_template = dirname(__FILE__) . '/center_inner_public.tpl';
         }
         $obj_inner_template =& new Template($inner_template);
         $obj_inner_template->set('links', $audio_data);
         $obj_inner_template->set('uid', $this->uid);
         $obj_inner_template->set('frnd_list', $frnd_list);
         $obj_inner_template->set('my_all_album', $this->my_all_album);
         $obj_inner_template->set('show_view', $this->show_view);
         $inner_html = $obj_inner_template->fetch();
         return $inner_html;
     } else {
         parent::set_group_media_gallery();
         //------------- Handling the Groups Media gallery -----------
         $group = ContentCollection::load_collection((int) $_GET['gid'], $_SESSION['user']['id']);
         $audio_data = Audio::load_audios_for_collection_id($_GET['gid'], $limit = 0);
         $audio_data['album_id'] = $group->collection_id;
         $audio_data['album_name'] = $group->title;
         $inner_template = NULL;
         switch ($this->mode) {
             default:
                 $inner_template = dirname(__FILE__) . '/center_inner_public_groups.tpl';
         }
         $obj_inner_template =& new Template($inner_template);
         $obj_inner_template->set('links', $audio_data);
         $obj_inner_template->set('show_view', $this->show_view);
         $obj_inner_template->set('my_all_groups', $this->group_ids);
         $inner_html = $obj_inner_template->fetch();
         return $inner_html;
     }
 }
Example #2
0
?>
/img/trash.png' title='delete' alt='delete' /></a>
<h3 style='color:#<?php 
echo get_item_info_from_id($data['type'], 'bgcolor');
?>
'><?php 
echo get_item_info_from_id($data['type'], 'name');
?>
 </h3>
<?php 
echo "<span class='date'><img src='themes/" . $_SESSION['prefs']['theme'] . "/img/calendar.png' title='date' alt='Date :' />" . $data['date'] . "</span><br />";
show_stars($data['rating']);
// buttons
echo "<a href='database.php?mode=edit&id=" . $data['id'] . "'><img src='themes/" . $_SESSION['prefs']['theme'] . "/img/edit.png' title='edit' alt='edit' /></a> \n<a href='duplicate_item.php?id=" . $data['id'] . "&type=db'><img src='themes/" . $_SESSION['prefs']['theme'] . "/img/duplicate.png' title='duplicate item' alt='duplicate' /></a> \n<a href='make_pdf.php?id=" . $data['id'] . "&type=items'><img src='themes/" . $_SESSION['prefs']['theme'] . "/img/pdf.png' title='make a pdf' alt='pdf' /></a> \n<a href='javascript:window.print()'><img src='themes/" . $_SESSION['prefs']['theme'] . "/img/print.png' title='Print this page' alt='Print' /></a> \n<a href='make_zip.php?id=" . $data['id'] . "&type=items'><img src='themes/" . $_SESSION['prefs']['theme'] . "/img/zip.gif' title='make a zip archive' alt='zip' /></a>\n<a href='experiments.php?mode=show&related=" . $data['id'] . "'><img src='img/related.png' alt='Linked experiments' title='Linked experiments' /></a>";
// TAGS
echo show_tags($id, 'items_tags');
// TITLE : click on it to go to edit mode
?>
<div OnClick="document.location='database.php?mode=edit&id=<?php 
echo $data['id'];
?>
'" class='title'>
    <?php 
echo stripslashes($data['title']);
?>
</div>
<?php 
// BODY (show only if not empty)
if ($data['body'] != '') {
    ?>
    <div OnClick="document.location='database.php?mode=edit&id=<?php 
Example #3
0
            $content = array();
            $counter++;
        } elseif (preg_match('/^E\\s+(\\w+)$/', $line, $matches)) {
            $field = $matches[1];
            // $content->$field .= $line;
        } elseif (preg_match('/^D\\s+(.*)$/', $line, $matches)) {
            $value = $matches[1];
            $content[$field] .= $value . "\n";
        } else {
            //print ">>>ditto: $line";
        }
    }
    $arr_tags = get_tags($arr_tags, $content['CONTENTS']);
    fclose($handle);
    print "counter={$counter}\n";
    show_tags($arr_tags);
} else {
    // error opening the file.
}
function get_tags($arr_tags, $instr)
{
    $tag_name = '';
    $tag = 0;
    $strlen = strlen($instr);
    for ($i = 0; $i <= $strlen; $i++) {
        $ch = substr($instr, $i, 1);
        if (preg_match('/[\\[\\]\\<\\>]/', $ch)) {
            $tag = !$tag;
            $tag_name .= $ch;
            if (!$tag && $tag_name != '') {
                //print "TAG: $tag_name\n";
Example #4
0
" target="_blank"><?php 
                                    echo $row_bookmark['url'];
                                    ?>
</a></p>
			   <p><i class="icon-time"></i>  <?php 
                                    echo parse_date($row_friends_activities_query['date']);
                                    ?>
 
			   <?php 
                                    feed_conversation_icons($row_friends_activities_query['profile_ida'], $row_friends_activities_query['activity_tracker'], "bookmark");
                                    ?>
</p>
			    <?php 
                                    feed_comments($row_friends_activities_query['profile_ida'], $row_friends_activities_query['activity_tracker'], "bookmark");
                                    $tags = get_tags($row_friends_activities_query['activity_tracker'], 'bookmark');
                                    show_tags($tags);
                                    ?>
		 </div>
		<?php 
                                    if ($_SESSION['logged'] == true) {
                                        vote_up($row_friends_activities_query['activity_tracker'], 'bookmark', $row_friends_activities_query['profile_ida']);
                                    }
                                    ?>
	</div>
 
 <?php 
                                } else {
                                    // *****************************************for showing topic updates ***********************
                                    $user1_info = get_user_info($row_friends_activities_query['profile_ida']);
                                    $row_bookmark = get_user_bookmark($row_friends_activities_query['activity_tracker']);
                                    $topic_details = get_topic_details($row_friends_activities_query['profile_idb']);
Example #5
0
function showDB($id, $display)
{
    // Show unique DB item
    global $bdd;
    // SQL to get everything from selected id
    $sql = "SELECT * FROM items WHERE id = :id";
    $req = $bdd->prepare($sql);
    $req->execute(array('id' => $id));
    $final_query = $req->fetch();
    if ($display === 'compact') {
        // COMPACT MODE //
        ?>
            <section class='item'>
            <h4 style='color:#<?php 
        echo get_item_info_from_id($final_query['type'], 'bgcolor');
        ?>
'><?php 
        echo get_item_info_from_id($final_query['type'], 'name');
        ?>
 </h4>
            <span class='date date_compact'><?php 
        echo $final_query['date'];
        ?>
</span>
            <span><?php 
        echo stripslashes($final_query['title']);
        // view link
        echo "<a href='database.php?mode=view&id=" . $final_query['id'] . "'>\n        <img class='align_right' style='margin-left:5px;' src='img/view_compact.png' alt='view' title='view item' /></a>";
        // STAR RATING read only
        show_stars($final_query['rating']);
        echo "</section>";
    } else {
        // NOT COMPACT
        echo "<section class='item'>";
        echo "<h4 style='color:#" . get_item_info_from_id($final_query['type'], 'bgcolor') . "'>" . get_item_info_from_id($final_query['type'], 'name') . " </h4>";
        // TAGS
        echo show_tags($id, 'items_tags');
        // view link
        echo "<a href='database.php?mode=view&id=" . $final_query['id'] . "'>\n        <img class='align_right' style='margin-left:5px;' src='img/view.png' alt='view' title='view item' /></a>";
        // STARS
        show_stars($final_query['rating']);
        // show attached if there is a file attached
        if (has_attachement($final_query['id'])) {
            echo "<img class='align_right' src='themes/" . $_SESSION['prefs']['theme'] . "/img/attached_file.png' alt='file attached' />";
        }
        echo "<p class='title'>" . stripslashes($final_query['title']) . "</p>";
        echo "</section>";
    }
}
     $article = explode("<--PAGEBREAK-->", $article);
 } else {
     $article = explode("<!-- pagebreak -->", $article);
 }
 $pagecount = count($article);
 $article_subject = stripslashes($data['article_subject']);
 $article_info = array("article_id" => (int) $_GET['article_id'], "cat_id" => $data['article_cat_id'], "cat_name" => $data['article_cat_name'], "user_id" => $data['user_id'], "user_name" => $data['user_name'], "user_status" => $data['user_status'], "article_subject" => $article_subject, "article_date" => $data['article_datestamp'], "article_breaks" => $data['article_breaks'], "article_comments" => dbcount("(comment_id)", DB_COMMENTS, "comment_type='A' AND comment_item_id='" . (int) $_GET['article_id'] . "'"), "article_reads" => $data['article_reads'], "article_allow_comments" => $data['article_allow_comments']);
 add_to_title($locale['global_201'] . $article_subject);
 set_meta('keywords', $data['article_keywords'], false);
 set_meta('description', trimlink($article_subject, 255), false);
 echo "<!--pre_article-->";
 render_article($article_subject, $article[$_GET['page'] - 1], $article_info);
 echo "<!--sub_article-->";
 if ($settings['enable_tags']) {
     require_once INCLUDES . "tag_include.php";
     echo show_tags((int) $_GET['article_id'], "A");
 }
 if ($pagecount > 1) {
     echo "<div align='center' style='margin-top:5px;'>\n";
     echo pagination(true, (int) $_GET['page'] - 1, 1, $pagecount, 3, FUSION_SELF . "?article_id=" . (int) $_GET['article_id'] . "&amp;", "article", "-", (int) $_GET['article_id'], "-page-", "-", $article_subject);
     echo "\n</div>\n";
 }
 if ($data['article_allow_comments']) {
     require_once INCLUDES . "comments_include.php";
     showcomments("A", DB_ARTICLES, "article_id", (int) $_GET['article_id'], FUSION_SELF . "?article_id=" . (int) $_GET['article_id'], "article", "-", (int) $_GET['article_id'], "-page-", (int) $_GET['page'], "-", $article_subject);
 }
 if ($data['article_allow_ratings'] && $settings['ratings_enabled'] == "1") {
     require INCLUDES . "ratings_include.php";
     showratings("A", (int) $_GET['article_id'], FUSION_SELF . "?article_id=" . (int) $_GET['article_id'], "article-" . (int) $_GET['article_id'] . "-", $article_subject);
 }
 if ($settings['sharethis_article']) {
 function generate_inner_html()
 {
     global $login_uid;
     $video_data = NULL;
     if (!isset($_GET['gid']) || empty($_GET['gid'])) {
         parent::set_vars();
         $frnd_list = null;
         if (!empty($_GET['view'])) {
             $frnd_list = $this->friend_list;
         }
         $sb_videos = array();
         $new_album = new Album(VIDEO_ALBUM);
         if ($this->album_id) {
             $new_album = new Album();
             $new_album->album_type = VIDEO_ALBUM;
             $new_album->load($this->album_id);
             $album_data['album_id'] = $new_album->collection_id;
             $album_data['album_name'] = $new_album->title;
         } else {
             $new_album->collection_id = $this->default_album_id;
             $album_data['album_id'] = $this->default_album_id;
             $album_data['album_name'] = $this->default_album_name;
         }
         $params = $condition = array();
         if (!empty(PA::$page_uid) || PA::$login_uid != PA::$page_uid) {
             $condition['M.video_perm'] = !empty($this->friend_list) && in_array(PA::$page_uid, $this->friend_list) ? array(WITH_IN_DEGREE_1, ANYONE) : ANYONE;
         }
         $condition['C.collection_id'] = $album_data['album_id'];
         $video_info = TekVideo::get($params, $condition);
         $video_ids = objtoarray($video_info);
         if (!empty($video_ids)) {
             $k = 0;
             $ids = array();
             for ($i = 0; $i < count($video_ids); $i++) {
                 if ($video_ids[$i]['type'] != 7) {
                     // Type 7 is for SB Content
                     $ids[$i] = $video_ids[$i]['content_id'];
                 } else {
                     $tags = Tag::load_tags_for_content($video_ids[$i]['content_id']);
                     $tags = show_tags($tags, null);
                     //show_tags function is defined in uihelper.php
                     $sb_videos[] = array('content_id' => $video_ids[$i]['content_id'], 'title' => $video_ids[$i]['title'], 'type' => $video_ids[$i]['type'], 'created' => $video_ids[$i]['created'], 'tags' => $tags);
                 }
             }
             if (count($video_ids) > 0) {
                 $video_data = $video_ids;
             }
             // Merging Media Gallery content and SB Content
             for ($counter = 0; $counter < count($sb_videos); $counter++) {
                 $video_data[$k]['content_id'] = $sb_videos[$counter]['content_id'];
                 $video_data[$k]['title'] = $sb_videos[$counter]['title'];
                 $video_data[$k]['type'] = $sb_videos[$counter]['type'];
                 $video_data[$k]['video_caption'] = $sb_videos[$counter]['title'];
                 $video_data[$k]['created'] = $sb_videos[$counter]['created'];
                 $video_data[$k]['tags'] = $sb_videos[$counter]['tags'];
                 $k++;
             }
         }
         if (!empty($_GET['view'])) {
             if (empty($frnd_list)) {
                 $video_data = NULL;
             }
         }
         $inner_template = NULL;
         switch ($this->mode) {
             default:
                 $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public.tpl';
         }
         $obj_inner_template = new Template($inner_template);
         $obj_inner_template->set('links', $video_data);
         $obj_inner_template->set('album_data', $album_data);
         $obj_inner_template->set('uid', $this->uid);
         $obj_inner_template->set('frnd_list', $frnd_list);
         $obj_inner_template->set('my_all_album', $this->my_all_album);
         $obj_inner_template->set('show_view', $this->show_view);
         $inner_html = $obj_inner_template->fetch();
         return $inner_html;
     } else {
         // ----- Calling parents function which set all the Require variables
         parent::set_group_media_gallery();
         //------------- Handling the Groups Media gallery -----------
         $group = ContentCollection::load_collection((int) $_GET['gid'], $_SESSION['user']['id']);
         $params = $condition = array();
         $album_data['album_id'] = $group->collection_id;
         $album_data['album_name'] = $group->title;
         $condition['C.collection_id'] = $album_data['album_id'];
         $video_info = TekVideo::get($params, $condition);
         $video_data = objtoarray($video_info);
         //         $video_data = Video::load_videos_for_collection_id ($_GET['gid'], $limit = 0);
         $i = 0;
         if (!empty($video_data)) {
             foreach ($video_data as $data) {
                 $tags_array = Tag::load_tags_for_content($data['content_id']);
                 $tags_string = "";
                 $tags_string = show_all_contents_for_tag($tags_array);
                 $video_data[$i]['tags'] = $tags_string;
                 $i++;
             }
         }
         $inner_template = NULL;
         switch ($this->mode) {
             default:
                 $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public_groups.tpl';
         }
         $obj_inner_template = new Template($inner_template);
         $obj_inner_template->set('links', $video_data);
         $obj_inner_template->set('album_data', $album_data);
         $obj_inner_template->set('show_view', $this->show_view);
         $obj_inner_template->set('my_all_groups', $this->group_ids);
         $inner_html = $obj_inner_template->fetch();
         return $inner_html;
     }
 }
    echo "<td align='right' style='padding-top:10px'>\n<!--post_forum_buttons-->\n";
    if (!$fdata['thread_locked'] && $can_reply) {
        echo "<a href='" . make_url(FORUM . "post.php?action=reply&amp;forum_id=" . $fdata['forum_id'] . "&amp;thread_id=" . $_GET['thread_id'], FORUM . "post.php?action=reply&amp;forum_id=" . $fdata['forum_id'] . "&amp;thread_id=" . $_GET['thread_id'], "", "") . "'><img src='" . get_image("reply") . "' alt='" . $locale['565'] . "' style='border:0px' /></a>\n";
        // Pimped: make_url, but no seo url-rewrite
    }
    if ($can_post) {
        echo "<a href='" . make_url(FORUM . "post.php?action=newthread&amp;forum_id=" . (int) $fdata['forum_id'], BASEDIR . "forum-newthread-" . (int) $fdata['forum_id'], "", ".html") . "'><img src='" . get_image("newthread") . "' alt='" . $locale['566'] . "' style='border:0px' /></a>\n";
        // Pimped: make_url
    }
    echo "</td>\n</tr>\n</table>\n";
}
closetable();
// Tag System
if ($settings['enable_tags']) {
    require_once INCLUDES . "tag_include.php";
    echo show_tags((int) $_GET['thread_id'], "F");
}
if ($can_reply && !$fdata['thread_locked']) {
    require_once INCLUDES . "bbcode_include.php";
    opentable($locale['512']);
    echo "<form name='inputform' method='post' action='" . FORUM . "post.php?action=reply&amp;forum_id=" . $fdata['forum_id'] . "&amp;thread_id=" . $_GET['thread_id'] . "'>\n";
    echo "<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
    echo "<td align='center' class='tbl1'><textarea name='message' cols='70' rows='7' class='textbox' style='width:98%'></textarea><br />\n";
    echo display_bbcodes("360px", "message") . "</td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td align='center' class='tbl2'><label><input type='checkbox' name='disable_smileys' value='1' />" . $locale['513'] . "</label>\n";
    if (array_key_exists("user_sig", $userdata) && $userdata['user_sig']) {
        echo "<br />\n<label><input type='checkbox' name='show_sig' value='1'/ checked='checked'>" . $locale['513a'] . "</label>";
    }
    echo "</td></tr>\n<tr>\n";
    echo "<td align='center' class='tbl1'><input type='submit' name='postreply' value='" . $locale['514'] . "' class='button' /></td>\n";
Example #9
0
function show_media($id = '', $tabla = '', $mode = '', $simple = 0, $array = '', $disableExtras = false, $destacarBtn = false)
{
    global $config;
    if ($disableExtras) {
        $disable = 'disabled="disabled"';
    }
    // -------------------------------------------------------------------------------------------
    // MODE VIDEOS -------------------------------------------------------------------------------
    // -------------------------------------------------------------------------------------------
    if ($mode == 'videos') {
        if ($array) {
            $media = $array;
        } else {
            $media = q("SELECT * FROM files WHERE item_id=" . $id . " AND (tipo = 'videos' OR tipo = 'youtube') AND tabla='" . $tabla . "' order by orden");
        }
        if ($simple == 0) {
            init_sort_galeria('files');
        }
        if (!$media) {
            noHayContenidosNota();
        } else {
            echo '<div class="sort_galeria">';
            foreach ($media as $row) {
                $tags = show_tags($row['id'], 'files');
                if ($row['tipo'] == 'youtube') {
                    $path = $row['youtube_id'];
                    $preview = 'http://i.ytimg.com/vi/' . validarYoutubeUrl($row['youtube_id']) . '/hqdefault.jpg';
                    $video = urldecode($path);
                } else {
                    $path = '_uploads/' . $row['tabla'] . '/' . $row['nombre'];
                    if (!$config['convertVideo']) {
                        if (!$row['fuente']) {
                            $preview = '_uploads/no_disp.jpg';
                        } else {
                            $preview = '_uploads/' . $row['tabla'] . '/' . $row['fuente'];
                        }
                        $video = $path;
                    } else {
                        $preview = substr(trim($path), 0, strlen(trim($path)) - 4) . '-converted.flv1.jpg';
                        $video = substr(trim($path), 0, strlen(trim($path)) - 4) . '-converted.flv';
                    }
                }
                $prefijo = $row['id'];
                // ---- si existe video convertido y existe el preview poner el player ---------------------------- //
                if ($row['youtube_id'] || file_exists($video) && file_exists($preview)) {
                    if ($array) {
                        echo '<div class="video_galeria" id="item_' . $row['id'] . '">';
                    } else {
                        echo '<div id="item_' . $row['id'] . '">';
                    }
                    if ($row['titulo']) {
                        echo '<h3>' . cortar($row['titulo'], 50, 0, '...') . '</h3>';
                    } else {
                        echo '<h3>' . cortar($row['nombre'], 50, 0, '...') . '</h3>';
                    }
                    // PAYER
                    echo '<div class="player" style="background: #000;">
        					<div id="s' . $prefijo . '"></div>
        						<script type="text/javascript">
        							var s' . $prefijo . ' = new SWFObject("player.swf","ply","346","268","9","#000000");
        							s' . $prefijo . '.addParam("allowfullscreen","true");
        							s' . $prefijo . '.addParam("allowscriptaccess","always");
                                    s' . $prefijo . '.addParam("wmode","transparent");
        							s' . $prefijo . '.addVariable("file","' . $video . '");
        							s' . $prefijo . '.addVariable("image","' . $preview . '");
                                    s' . $prefijo . '.addVariable("skin","modieus.swf");
        							//s' . $prefijo . '.addVariable("duration","' . get_duration($row['id'], $id, $row['tabla'], $video) . '");
        							s' . $prefijo . '.write("s' . $prefijo . '");   
        						</script>';
                    echo '</div>';
                    //BOTONES
                    echo '<div class="buttons">';
                    //BORRAR
                    borrarMediaBtn($row);
                    if ($simple == 0) {
                        //MOVER
                        moverBtn();
                        //DESTACAR
                        if ($destacarBtn) {
                            destacarBtn($row, $mode);
                        }
                        //INFO
                        infoBtn($row, $mode, $disable, $tags);
                    }
                    echo '</div>';
                    echo '</div>';
                }
                // ------------------ si se necesita convertir el video ------------------------------------------- //
                if (file_exists($path) && $row['nombre'] != '' && !file_exists($preview) && !file_exists($video)) {
                    if ($array) {
                        echo '<div class="video_galeria" id="item_' . $row['id'] . '">';
                    }
                    echo '<p><a href="javascript:convertVideo(\'' . $row['id'] . '\',\'' . $id . '\',\'' . $row['tabla'] . '\')">Existe un video para este Item. Sin embargo, debe convertir este video para que obtener una imagen de previsualizaciĆ³n y un formato apropiado para el sitio. Haga click en este enlace para comenzar la conversiĆ³n (Esto puede tardar unos minutos).</a></p>';
                    // BOTONES
                    echo '<div class="buttons">';
                    //BORRAR
                    echo '<a href="javascript:borrar(\'' . $row['id'] . '\',\'files\',\'delete_item\',\'' . $row['tabla'] . '\',\'videos\')" onclick="return boton_borrar();"><img class="buttons" src="img/admin/film_delete.png" alt="' . lang('borrar') . '" title="' . lang('borrar') . '"/></a>';
                    // CONVERTIR
                    echo '<a href="javascript:convertVideo(\'' . $row['id'] . '\',\'' . $id . '\',\'' . $row['tabla'] . '\')"><img class="buttons" src="img/admin/film_go.png" alt="Convertir" title="Convertir"/></a>';
                    echo '</div>';
                    if ($array) {
                        echo '</div>';
                    }
                }
            }
            echo '<div style="clear:both;"></div>';
            echo '</div>';
        }
    }
    // -------------------------------------------------------------------------------------------
    // MODE AUDIOS -------------------------------------------------------------------------------
    // -------------------------------------------------------------------------------------------
    if ($mode == 'audios') {
        if ($array) {
            $media = $array;
        } else {
            $media = db_result_to_array(mysql_query("SELECT * FROM files WHERE item_id=" . $id . " AND tipo = 'audios' AND tabla='" . $tabla . "' order by orden"));
        }
        init_sort_galeria('files');
        if ($media) {
            echo '<div class="sort_galeria">';
            foreach ($media as $row) {
                $tags = show_tags($row['id'], 'files');
                $path = '_uploads/' . $tabla . '/' . $row['nombre'];
                $audio = substr(trim($path), 0, strlen(trim($path)) - 4) . '-converted.flv';
                if (extension($path) == 'mp3') {
                    $audio = $path;
                }
                $prefijo = substr(md5(uniqid(rand())), 0, 2);
                // ---------------------- si existe audio convertido o existe archivo con formato mp3, poner el player -------------------------------- //
                if (file_exists($audio)) {
                    if ($array) {
                        echo '<div class="video_galeria" id="item_' . $row['id'] . '">';
                    }
                    if ($row['titulo']) {
                        echo '<h3>' . cortar($row['titulo'], 60, 0, '...') . '</h3>';
                    } else {
                        echo '<h3>' . cortar($row['nombre'], 60, 0, '...') . '</h3>';
                    }
                    echo '<div class="player" style="color: #000;">
				<div id="s' . $prefijo . '"></div>
					<script type="text/javascript">
						var s' . $prefijo . ' = new SWFObject("player.swf","mpl","346","20","9","#000000");
						s' . $prefijo . '.addParam("allowfullscreen","true");
						s' . $prefijo . '.addParam("allowscriptaccess","always");
                        s' . $prefijo . '.addParam("wmode","rtansparent");
						s' . $prefijo . '.addVariable("file","' . $audio . '");
						//s' . $prefijo . '.addVariable("duration","' . get_duration($row['id'], $id, $tabla, $audio) . '");
                        s' . $prefijo . '.addVariable("skin","modieus.swf");
						s' . $prefijo . '.write("s' . $prefijo . '");
					</script>';
                    echo '</div>';
                    echo '<div class="buttons">';
                    //BORRAR
                    echo '<a href="javascript:borrar(\'' . $row['id'] . '\',\'files\',\'delete_item\',\'' . $row['tabla'] . '\',\'audios\')" onclick="return boton_borrar();"><img class="buttons" src="img/admin/audio/sound_delete.png" alt="' . lang('borrar') . '" title="' . lang('borrar') . '"/></a>';
                    //DESTACAR
                    if ($row['destacar'] == 1) {
                        echo '<a href="javascript:destacar(\'' . $row['id'] . '\',\'files\',\'no_destacar\',\'' . $tabla . '\',\'audios\',\'' . $row['item_id'] . '\',\'' . $row['item_id'] . '\')"><img class="buttons" src="img/admin/destacar.png" alt="no destacar" title="no destacar"/></a>';
                    } else {
                        echo '<a href="javascript:destacar(\'' . $row['id'] . '\',\'files\',\'destacar\',\'' . $tabla . '\',\'audios\',\'' . $row['item_id'] . '\')"><img class="buttons" src="img/admin/no_destacar.png" alt="destacar" title="destacar"/></a>';
                    }
                    // MOVER
                    echo '<a href="#" class="mover"><img class="buttons" src="img/admin/move.png" alt="mover" title="mover"/></a>';
                    // EDIT
                    echo '<a href="#edit" class="edit"><img class="buttons" src="img/admin/eye.png" alt="info" title="info"/></a>';
                    echo '<div class="edit_box" style="position:inherit;margin:5px 0 0 0;">';
                    echo '<h3>Audio Original</h3>';
                    echo '<p>' . ROOT . 'admin/_uploads/' . $tabla . '/' . substr($row['nombre'], 6, strlen($row['nombre'])) . ' <span style="color:#f00">Convertido, Borrado!</span></p>';
                    // EDIT FORM
                    echo '<p><input type="hidden" name="valores_' . $row['id'] . '" id="valores_' . $row['id'] . '" value="titulo_' . $row['id'] . ',texto_' . $row['id'] . ',fuente_' . $row['id'] . ',tags_' . $row['id'] . '" class="galeria_desc" /></p>';
                    echo '<p>Titulo</p>';
                    echo '<p><input type="text" name="titulo_' . $row['id'] . '" id="titulo_' . $row['id'] . '" value="' . htmlspecialchars_decode($row['titulo']) . '" class="galeria_desc" /></p>';
                    echo '<p>DescripciĆ³n</p>';
                    echo '<p><input type="text" name="texto_' . $row['id'] . '" id="texto_' . $row['id'] . '" value="' . htmlspecialchars_decode($row['texto']) . '" class="galeria_desc" /></p>';
                    echo '<p>Fuente</p>';
                    echo '<p><input type="text" name="fuente_' . $row['id'] . '" id="fuente_' . $row['id'] . '" value="' . htmlspecialchars_decode($row['fuente']) . '" class="galeria_desc" /></p>';
                    echo '<p>Etiquetas (tags)</p>';
                    echo '<p><input type="text" name="tags_' . $row['id'] . '" id="tags_' . $row['id'] . '" value="' . htmlspecialchars_decode($tags) . '" class="galeria_desc" /></p>';
                    echo '<p><a href="javascript:guardarInfo(\'valores_' . $row['id'] . '\',\'' . $row['id'] . '\',\'files\',\'' . $tabla . '\',\'audios\');"><img class="buttons" src="img/admin/aprobar.png" alt="guardar" title="guardar"/></a></p>';
                    // END EDIT FORM
                    echo '<h3>Audio Convertido</h3>';
                    echo '<p><a href="' . ROOT . 'admin/' . $audio . '">' . ROOT . 'admin/' . $audio . '</a></p>';
                    echo '<h3>+ Info</h3>';
                    echo get_data_audio($row['id'], $row['item_id'], $tabla, $audio);
                    echo '</div>';
                    echo '</div>';
                }
                // --------------------------------- si se necesita convertir el audio ------------------------------------------- //
                if (file_exists($path) && $row['nombre'] != '' && !file_exists($audio)) {
                    echo '<p><a href="javascript:convertAudio(\'' . $row['id'] . '\',\'' . $id . '\',\'' . $tabla . '\')">Existe un audio para este Item. Sin embargo, debe convertir este audio para obtener un formato apropiado para el sitio. Haga click en este enlace para comenzar la conversiĆ³n (Esto puede tardar unos minutos).</a></p>';
                    echo '<div class="buttons">';
                    //BORRAR
                    echo '<a href="javascript:borrar(\'' . $row['id'] . '\',\'files\',\'delete_item\',\'' . $row['tabla'] . '\',\'audios\')" onclick="return boton_borrar();"><img class="buttons" src="img/admin/audio/sound_delete.png" alt="' . lang('borrar') . '" title="' . lang('borrar') . '"/></a>';
                    // CONVERT
                    echo '<a href="javascript:convertAudio(\'' . $row['id'] . '\',\'' . $id . '\',\'' . $tabla . '\')"><img class="buttons" src="img/admin/audio/audio_go.png" alt="Convertir" title="Convertir"/></a>';
                    echo '</div>';
                }
                if ($array) {
                    echo '</div>';
                }
            }
            echo '</div>';
        } else {
            // --------------------------------- si no existe audio subido ------------------------------------------- //
            echo '<div class="player"><p><img src="_plugins/phpt/phpThumb.php?src=../../_uploads/no_disp.jpg&amp;w=346&amp;h=50" border="0" alt="no existen audios cargados" title="no existen audios cargados" /></p></div>';
        }
    }
    // -------------------------------------------------------------------------------------------
    // MODE BANNERS -------------------------------------------------------------------------------
    // -------------------------------------------------------------------------------------------
    if ($mode == 'banners') {
        $banners = db_result_to_array(mysql_query("SELECT * FROM files WHERE item_id=" . $id . " AND tipo = '" . $mode . "' AND tabla='" . $tabla . "' ORDER BY orden"));
        //echo "SELECT * FROM files WHERE item_id=".$id." AND tipo = '".$mode."' AND tabla='".$tabla."' ORDER BY orden";
        //pr($imagenes);
        init_sort_galeria('files');
        if ($banners) {
            echo '<div class="sort_galeria">';
            foreach ($banners as $row) {
                //$tags = show_tags($row['id'],'files');
                if (file_exists('_uploads/' . $row['tabla'] . '/' . $row['nombre']) && !empty($row['nombre'])) {
                    echo '<div class="imagenes_galeria" id="item_' . $row['id'] . '">';
                    if (extension($row['nombre']) == 'swf') {
                        $prefijo = substr(md5(uniqid(rand())), 0, 2);
                        echo '<div id="s' . $prefijo . '"></div>
						<script type="text/javascript">
						var s' . $prefijo . ' = new SWFObject("' . ROOT . 'admin/_uploads/' . $row['tabla'] . '/' . $row['nombre'] . '","mpl","163","127","9","#FFFFFF");
						s' . $prefijo . '.addParam("allowfullscreen","false");
						s' . $prefijo . '.addParam("allowscriptaccess","always");
						s' . $prefijo . '.addParam("quality", "high");
						s' . $prefijo . '.addParam("wmode","opaque");
						s' . $prefijo . '.addParam("menu", "false");
						s' . $prefijo . '.addParam("salign", "t");
						s' . $prefijo . '.write("s' . $prefijo . '");
						</script>';
                    } else {
                        echo '<p><img src="_plugins/phpt/phpThumb.php?src=../../_uploads/' . $row['tabla'] . '/' . $row['nombre'] . '&amp;w=163&amp;h=127&amp;zc=0" alt="' . $row['titulo'] . '" title="' . $row['titulo'] . '" /></p>';
                    }
                    echo '<div class="buttons">';
                    //BORRAR
                    echo '<a href="javascript:borrar(\'' . $row['id'] . '\',\'files\',\'delete_item\',\'' . $row['tabla'] . '\',\'banners\')" onclick="return boton_borrar();"><img class="buttons" src="img/admin/delete.png" alt="borrar" title="borrar"/></a>';
                    if ($simple == 0) {
                        //DESTACAR
                        if ($row['destacar'] == 1) {
                            echo '<a href="javascript:destacar(\'' . $row['id'] . '\',\'files\',\'no_destacar\',\'' . $row['tabla'] . '\',\'' . $mode . '\',\'' . $row['item_id'] . '\')"><img class="buttons" src="img/admin/destacar.png" alt="no destacar" title="no destacar"/></a>';
                        } else {
                            echo '<a href="javascript:destacar(\'' . $row['id'] . '\',\'files\',\'destacar\',\'' . $row['tabla'] . '\',\'' . $mode . '\',\'' . $row['item_id'] . '\')"><img class="buttons" src="img/admin/no_destacar.png" alt="destacar" title="destacar"/></a>';
                        }
                    }
                    // MOVER
                    echo '<a href="#move" class="mover"><img class="buttons" src="img/admin/move.png" alt="mover" title="mover"/></a>';
                    //INFO
                    /* echo '<a href="#info" class="edit"><img class="buttons" src="img/admin/editar_datos.png" alt="info" title="info"/></a>';
                    
                                          echo '<div class="edit_box" style="position:inherit;border:none;padding:0;">';
                    
                                          echo '<p><input type="hidden" name="valores_'.$row['id'].'" id="valores_'.$row['id'].'" value="titulo_'.$row['id'].',texto_'.$row['id'].',fuente_'.$row['id'].',tags_'.$row['id'].'" class="galeria_desc" /></p>';
                    
                                          //echo '<h3>Foto Original</h3>';
                                          //echo '<p>'.ROOT.'admin/_uploads/'.$tabla.'/'.substr($row['nombre'],6,strlen($row['nombre'])).' <span style="color:#f00">Convertido, Borrado!</span></p>';
                    
                                          echo '<p>Titulo</p>';
                                          echo '<p><input type="text" name="titulo_'.$row['id'].'" id="titulo_'.$row['id'].'" value="'.htmlspecialchars_decode($row['titulo']).'" class="galeria_desc" /></p>';
                                          echo '<p>DescripciĆ³n</p>';
                                          echo '<p><input type="text" name="texto_'.$row['id'].'" id="texto_'.$row['id'].'" value="'.htmlspecialchars_decode($row['texto']).'" class="galeria_desc" /></p>';
                                          echo '<p>Fuente</p>';
                                          echo '<p><input type="text" name="fuente_'.$row['id'].'" id="fuente_'.$row['id'].'" value="'.htmlspecialchars_decode($row['fuente']).'" class="galeria_desc" /></p>';
                                          echo '<p>Etiquetas (tags)</p>';
                                          echo '<p><input type="text" name="tags_'.$row['id'].'" id="tags_'.$row['id'].'" value="'.htmlspecialchars_decode($tags).'" class="galeria_desc" /></p>';
                                          echo '<p><a href="javascript:guardarInfo(\'valores_'.$row['id'].'\',\''.$row['id'].'\',\'files\',\''.$row['tabla'].'\',\''.$mode.'\');"><img class="buttons" src="img/admin/aprobar.png" alt="guardar" title="guardar"/></a></p>';
                                          echo '</div>'; */
                    echo '</div>';
                    echo '</div>';
                }
            }
            echo '</div>';
        } else {
            // --------------------------------- si no existe imagen subida ------------------------------------------- //
            echo '<div class="player"><p><img src="_plugins/phpt/phpThumb.php?src=../../_uploads/no_disp.jpg&amp;w=346&amp;h=50" border="0" alt="no existen imagenes cargadas" title="no existen imagenes cargadas" /></p></div>';
        }
    }
    // -------------------------------------------------------------------------------------------
    // MODE PDF -------------------------------------------------------------------------------
    // -------------------------------------------------------------------------------------------
    if ($mode == 'pdf') {
        if ($array) {
            $pdf = $array;
        } else {
            $pdf = q("SELECT * FROM files WHERE item_id=" . $id . " AND tipo = '" . $mode . "' AND tabla='" . $tabla . "' ORDER BY orden");
        }
        if ($simple == 0) {
            init_sort_galeria('files');
        }
        if (!$pdf) {
            noHayContenidosNota();
        } else {
            echo '<div class="sort_galeria">';
            foreach ($pdf as $row) {
                $row['titulo'] = f($row['titulo']);
                $tags = show_tags($row['id'], 'files');
                if (file_exists('_uploads/' . $row['tabla'] . '/' . $row['nombre']) && !empty($row['nombre'])) {
                    echo '<div class="imagenes_galeria" id="item_' . $row['id'] . '">';
                    echo '<img src="_plugins/phpt/phpThumb.php?src=../../_uploads/pdf_file.png&amp;w=163&amp;h=127&amp;zc=1" alt="' . $row['titulo'] . '" title="' . $row['titulo'] . '" />';
                    //BOTONES
                    echo '<div class="buttons">';
                    //BORRAR
                    borrarBtn($row, $mode, 'delete.png', 'files');
                    if ($simple == 0) {
                        //MOVER
                        moverBtn();
                        //DESTACAR
                        if ($destacarBtn) {
                            destacarBtn($row, $mode);
                        }
                        //INFO
                        infoBtn($row, $mode, $disable, $tags);
                    }
                    echo '</div>';
                    echo '</div>';
                }
            }
            echo '<div style="clear:both;"></div>';
            echo '</div>';
        }
    }
}
        } else {
            echo "<div class='viewpage'>" . $custompage . "</div>";
        }
        echo itemoptions("CP", (int) $_GET['page_id']);
        // Pimped
    } else {
        echo "<div style='text-align:center'><br />\n" . $locale['400'] . "\n<br /><br /></div>\n";
    }
} else {
    add_to_title($locale['global_200'] . $locale['401']);
    opentable($locale['401']);
    echo "<div style='text-align:center'><br />\n" . $locale['402'] . "\n<br /><br /></div>\n";
}
closetable();
if (dbrows($cp_result) && checkgroup($cp_data['page_access'])) {
    if ($settings['enable_tags']) {
        require_once INCLUDES . "tag_include.php";
        // Pimped: tag
        echo show_tags((int) $_GET['page_id'], "C");
        // Pimped: tag
    }
    if ($cp_data['page_allow_comments']) {
        require_once INCLUDES . "comments_include.php";
        showcomments("C", DB_CUSTOM_PAGES, "page_id", (int) $_GET['page_id'], FUSION_SELF . "?page_id=" . (int) $_GET['page_id'], "page", "-", (int) $_GET['page_id'], "", "", "-", $cp_data['page_title']);
    }
    if ($cp_data['page_allow_ratings'] && $settings['ratings_enabled'] == "1") {
        require INCLUDES . "ratings_include.php";
        showratings("C", (int) $_GET['page_id'], FUSION_SELF . "?page_id=" . (int) $_GET['page_id'], "page-" . (int) $_GET['page_id'] . "-", $cp_data['page_title']);
    }
}
require_once TEMPLATES . "footer.php";
Example #11
0
<?php

echo heading($title, 2);
//time format!
$format = "%m/%d/%Y %h:%i %a";
//print_r($results);
$stamp = mysql_to_unix($results->created);
echo "<small>posted " . mdate($format, $stamp);
echo " by " . $usernames[$results->user_id] . br();
echo "</small>";
echo br();
echo auto_typography($results->body);
echo br(2);
show_tags($post_tags, $results->id);
echo br(2);
comments($comments, $results->id, 'posts', $usernames, $format, 'blog/index');
 function generate_inner_html()
 {
     global $login_uid;
     if (!isset($_GET['gid']) || empty($_GET['gid'])) {
         parent::set_vars();
         $frnd_list = null;
         if (!empty($_GET['view'])) {
             $frnd_list = $this->friend_list;
         }
         $sb_images = array();
         $new_album = new Album(IMAGE_ALBUM);
         if ($this->album_id) {
             $new_album = new Album();
             $new_album->album_type = IMAGE_ALBUM;
             $new_album->load($this->album_id);
             $image_data['album_id'] = $new_album->collection_id;
             $image_data['album_name'] = $new_album->title;
         } else {
             $new_album->collection_id = $this->default_album_id;
             $image_data['album_id'] = $this->default_album_id;
             $image_data['album_name'] = $this->default_album_name;
         }
         $image_ids = $new_album->get_contents_for_collection();
         $k = 0;
         $ids = array();
         if (!empty($image_ids)) {
             for ($i = 0; $i < count($image_ids); $i++) {
                 if ($image_ids[$i]['type'] != 7) {
                     // Type 7 is for SB Content
                     $ids[$i] = $image_ids[$i]['content_id'];
                 } else {
                     $var = $image_ids[$i]['body'];
                     $start = strpos($var, '<image>') + 7;
                     if ($start > 7) {
                         $end = strpos($var, '</image>');
                         $image_src = substr($var, $start, $end - $start);
                         $tags = Tag::load_tags_for_content($image_ids[$i]['content_id']);
                         $tags = show_tags($tags, null);
                         //show_tags function is defined in uihelper.php
                         $sb_images[] = array('content_id' => $image_ids[$i]['content_id'], 'title' => $image_ids[$i]['title'], 'type' => $image_ids[$i]['type'], 'created' => $image_ids[$i]['created'], 'tags' => $tags, 'image_src' => $image_src);
                     }
                 }
             }
             $new_image = new Image();
             $data = $new_image->load_many($ids, $this->uid, $login_uid);
             if (count($data) > 0) {
                 foreach ($data as $d) {
                     $image_data[$k]['content_id'] = $d['content_id'];
                     $image_data[$k]['image_file'] = $d['image_file'];
                     $image_data[$k]['image_caption'] = $d['image_caption'];
                     $image_data[$k]['title'] = $d['title'];
                     $image_data[$k]['body'] = $d['body'];
                     $image_data[$k]['created'] = $d['created'];
                     $image_data[$k]['type'] = "";
                     $tags_array = Tag::load_tags_for_content($d['content_id']);
                     $tags_string = "";
                     $tags_string = show_all_contents_for_tag($tags_array);
                     $image_data[$k]['tags'] = $tags_string;
                     $k++;
                 }
             }
             // Merging Media Gallery content and SB Content
             for ($counter = 0; $counter < count($sb_images); $counter++) {
                 $image_data[$k]['content_id'] = $sb_images[$counter]['content_id'];
                 $image_data[$k]['title'] = $sb_images[$counter]['title'];
                 $image_data[$k]['type'] = $sb_images[$counter]['type'];
                 $image_data[$k]['image_caption'] = $sb_images[$counter]['title'];
                 $image_data[$k]['created'] = $sb_images[$counter]['created'];
                 $image_data[$k]['tags'] = $sb_images[$counter]['tags'];
                 $image_data[$k]['image_src'] = $sb_images[$counter]['image_src'];
                 $k++;
             }
         }
         if (!empty($_GET['view'])) {
             if (empty($frnd_list)) {
                 $image_data = NULL;
             }
         }
         $inner_template = NULL;
         switch ($this->mode) {
             default:
                 $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public.tpl';
         }
         $obj_inner_template = new Template($inner_template);
         $obj_inner_template->set('links', $image_data);
         $obj_inner_template->set('frnd_list', $frnd_list);
         $obj_inner_template->set('uid', $this->uid);
         $obj_inner_template->set('my_all_album', $this->my_all_album);
         $obj_inner_template->set('show_view', $this->show_view);
         $inner_html = $obj_inner_template->fetch();
         return $inner_html;
     } else {
         parent::set_group_media_gallery();
         //------------- Handling the Groups Media gallery -----------
         $group = ContentCollection::load_collection((int) $_GET['gid'], $_SESSION['user']['id']);
         $image_data = Image::load_images_for_collection_id($_GET['gid'], $limit = 0);
         $i = 0;
         if (!empty($image_data)) {
             foreach ($image_data as $data) {
                 $tags_array = Tag::load_tags_for_content($data['content_id']);
                 $tags_string = "";
                 $tags_string = show_all_contents_for_tag($tags_array);
                 $image_data[$i]['tags'] = $tags_string;
                 $i++;
             }
         }
         $image_data['album_id'] = $group->collection_id;
         $image_data['album_name'] = $group->title;
         $inner_template = NULL;
         switch ($this->mode) {
             default:
                 $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public_groups.tpl';
         }
         $obj_inner_template = new Template($inner_template);
         $obj_inner_template->set('links', $image_data);
         $obj_inner_template->set('my_all_groups', $this->group_ids);
         $obj_inner_template->set('show_view', $this->show_view);
         $inner_html = $obj_inner_template->fetch();
         return $inner_html;
     }
 }
Example #13
0
<?php

echo heading($title, 2);
//time format!
$format = "%m/%d/%Y %h:%i %a";
echo auto_link($results->url, 'url', TRUE) . br();
echo $results->description . br();
$stamp = mysql_to_unix($results->created);
echo "<small>posted " . mdate($format, $stamp);
echo " by " . $usernames[$results->user_id] . br();
echo "</small>";
show_tags($bookmark_tags, $results->id);
echo br(2);
comments($comments, $results->id, 'bookmarks', $usernames, $format, 'bookmarks/index');
Example #14
0
/**
 * Display a DB item (in mode=show).
 *
 * @param int $id The ID of the item to show
 * @param string $display Can be 'compact' or 'default'
 * @return string|null HTML of the single item
 */
function showDB($id, $display = 'default')
{
    global $pdo;
    $sql = "SELECT items.*,\n        items_types.bgcolor,\n        items_types.name\n        FROM items\n        LEFT JOIN items_types ON (items.type = items_types.id)\n        WHERE items.id = :id";
    $req = $pdo->prepare($sql);
    $req->execute(array('id' => $id));
    $item = $req->fetch();
    if ($display === 'compact') {
        // COMPACT MODE //
        ?>
            <section class='item_compact' style='border-left: 6px solid #<?php 
        echo $item['bgcolor'];
        ?>
'>
            <a href='database.php?mode=view&id=<?php 
        echo $item['id'];
        ?>
'>
            <span class='date date_compact'><?php 
        echo $item['date'];
        ?>
</span>
            <h4 style='padding-left:10px;border-right:1px dotted #ccd;color:#<?php 
        echo $item['bgcolor'];
        ?>
'><?php 
        echo $item['name'];
        ?>
 </h4>
            <span style='margin-left:7px'><?php 
        echo stripslashes($item['title']);
        ?>
</span>
        <?php 
        // STAR RATING read only
        show_stars($item['rating']);
        echo "</a></section>";
    } else {
        // NOT COMPACT
        echo "<section class='item' style='border-left: 6px solid #" . $item['bgcolor'] . "'>";
        echo "<a href='database.php?mode=view&id=" . $item['id'] . "'>";
        // show attached if there is a file attached
        if (has_attachement($item['id'], 'items')) {
            echo "<img style='clear:both' class='align_right' src='img/attached.png' alt='file attached' />";
        }
        // STARS
        show_stars($item['rating']);
        echo "<p class='title'>";
        // show lock if item is locked on viewDB
        if ($item['locked'] == 1) {
            echo "<img style='padding-bottom:3px;' src='img/lock-blue.png' alt='lock' />";
        }
        // TITLE
        echo stripslashes($item['title']) . "</p></a>";
        // ITEM TYPE
        echo "<span style='text-transform:uppercase;font-size:80%;padding-left:20px;color:#" . $item['bgcolor'] . "'>" . $item['name'] . " </span>";
        // DATE
        echo "<span class='date' style='padding:0 5px;'><img class='image' src='img/calendar.png' /> " . Tools::formatDate($item['date']) . "</span> ";
        // TAGS
        echo show_tags($id, 'items_tags');
        echo "</section>";
    }
}
Example #15
0
     if ($data['news_breaks'] == "y") {
         $news_news = nl2br($news_news);
     }
     if ($news_cat_image != "") {
         $news_news = $news_cat_image . $news_news;
     }
     $news_info = array("news_id" => (int) $_GET['readmore'], "user_id" => $data['user_id'], "user_name" => $data['user_name'], "user_status" => $data['user_status'], "news_date" => $data['news_datestamp'], "news_subject" => $data['news_subject'], "cat_id" => $data['news_cat'], "cat_name" => $data['news_cat_name'], "news_ext" => "n", "news_reads" => $data['news_reads'], "news_comments" => dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='" . (int) $_GET['readmore'] . "' AND comment_hidden='0'"), "news_allow_comments" => $data['news_allow_comments'], "news_sticky" => $data['news_sticky']);
     add_to_title($locale['global_201'] . $news_subject);
     set_meta('keywords', $data['news_keywords'], false);
     set_meta('description', trimlink($news_subject, 255), false);
     echo "<!--news_pre_readmore-->";
     render_news($news_subject, $news_news, $news_info);
     echo "<!--news_sub_readmore-->";
     if ($settings['enable_tags']) {
         require_once INCLUDES . "tag_include.php";
         echo show_tags((int) $_GET['readmore'], "N");
     }
     if ($data['news_allow_comments']) {
         require_once INCLUDES . "comments_include.php";
         showcomments("N", DB_NEWS, "news_id", (int) $_GET['readmore'], FUSION_SELF . "?readmore=" . (int) $_GET['readmore']);
     }
     if ($data['news_allow_ratings'] && $settings['ratings_enabled'] == "1") {
         require INCLUDES . "ratings_include.php";
         showratings("N", (int) $_GET['readmore'], FUSION_SELF . "?readmore=" . (int) $_GET['readmore']);
     }
     if ($settings['sharethis_news']) {
         $share_this = "news";
         require_once INCLUDES . "share_this_include.php";
     }
 } else {
     redirect(FUSION_SELF);
Example #16
0
    }
    foreach ($tags as $id) {
        $tag = new MWTag($id);
        if ($tag->isNew()) {
            continue;
        }
        $tag->update_posts();
    }
    redirectMsg('tags.php?page=' . $page, __('Tags updated!', 'mywords'), 0);
}
$action = rmc_server_var($_REQUEST, 'action', '');
switch ($action) {
    case 'new':
        save_tag(false);
        break;
    case 'saveedit':
        save_tag(true);
        break;
    case 'edit':
        edit_form();
        break;
    case 'delete':
        delete_tag();
        break;
    case 'update':
        update_tag();
        break;
    default:
        show_tags();
        break;
}
 private function tags()
 {
     // SET VALUE AFTER SUBMIT ERRORS
     if ($_POST[$this->name] != '' && $this->value == '') {
         if (count($this->config['lang']) > 1 && $this->useLang) {
             //
         } else {
             $this->value = $_POST[$this->name];
         }
     }
     $this->value = show_tags($this->item_id, $this->tabla);
     $out[] = $this->getContainerDiv();
     // FIELD LABEL
     $out[] = $this->getFieldLabel();
     $name = $this->submitValue ? 'name="' . $this->name . '"' : '';
     $out[] = '<div class="inputWrapper ' . $this->inputWrapperCls . '">';
     $out[] = '<input style="' . $this->inputStyle . '" id="' . $this->id . '" ' . $name . ' ' . $this->disabled . ' class="' . $this->inputCls . '" onkeyup="' . $this->function . '" type="text" value="' . $this->value . '" tabindex="' . $this->tabIndex . '" />';
     $out[] = '</div>';
     if ($this->afterFieldHtml) {
         $out[] = '<div class="afterFieldHtml">' . $this->afterFieldHtml . '</div>';
     }
     $out[] = '</div>';
     return join("\n", $out);
 }
Example #18
0
</span>
<?php 
echo "<span class='date_view'><img src='img/calendar.png' class='bot5px' title='date' alt='Date :' /> " . Tools::formatDate($data['date']) . "</span><br />\n    <a href='experiments.php?mode=edit&id=" . $data['expid'] . "'><img src='img/pen-blue.png' title='edit' alt='edit' /></a>\n<a href='app/duplicate_item.php?id=" . $data['expid'] . "&type=exp'><img src='img/duplicate.png' title='duplicate experiment' alt='duplicate' /></a>\n<a href='make.php?what=pdf&id=" . $data['expid'] . "&type=experiments'><img src='img/pdf.png' title='make a pdf' alt='pdf' /></a>\n<a href='make.php?what=zip&id=" . $data['expid'] . "&type=experiments'><img src='img/zip.png' title='make a zip archive' alt='zip' /></a> ";
// lock
if ($data['locked'] == 0) {
    echo "<a href='app/lock.php?id=" . $data['expid'] . "&action=lock&type=experiments'><img src='img/unlock.png' title='lock experiment' alt='lock' /></a>";
} else {
    // experiment is locked
    echo "<a href='app/lock.php?id=" . $data['expid'] . "&action=unlock&type=experiments'><img src='img/lock-gray.png' title='unlock experiment' alt='unlock' /></a>";
    // show timestamp button if it's not timestamped already
    if ($data['timestamped'] == 0) {
        echo "<a onClick=\"return confirmStamp()\" href='app/timestamp.php?id=" . $data['expid'] . "'><img src='img/stamp.png' title='timestamp experiment' alt='timestamp' /></a>";
    }
}
// TAGS
show_tags($id, 'experiments_tags');
// TITLE : click on it to go to edit mode only if we are not in read only mode
echo "<div ";
if ($ro === false && $data['locked'] == 0) {
    echo "OnClick=\"document.location='experiments.php?mode=edit&id=" . $data['expid'] . "'\"";
}
echo " class='title_view'>";
echo stripslashes($data['title']) . "</div>";
// BODY (show only if not empty, click on it to edit
if ($data['body'] != '') {
    echo "<div id='body_view' ";
    // make the body clickable only if we are not in read only
    if ($ro === false && $data['locked'] == 0) {
        echo "OnClick=\"document.location='experiments.php?mode=edit&id=" . $data['expid'] . "'\"";
    }
    echo "class='txt'>" . stripslashes($data['body']) . "</div>";
Example #19
0
<?php

echo heading($title, 2);
//time format!
$format = "%m/%d/%Y %h:%i %a";
echo "Description: " . $results->description . br();
echo "File type: " . $results->file_type . br();
echo "File size: " . $results->file_size . br();
$stamp = mysql_to_unix($results->created);
echo anchor("files/download/" . $results->id, 'download') . br();
echo "<small>uploaded " . mdate($format, $stamp);
echo " by " . $usernames[$results->user_id] . br();
echo "</small>";
show_tags($file_tags, $results->id);
echo br(2);
comments($comments, $results->id, 'files', $usernames, $format, 'files/index');