[ Video Sharing CMS v4 ] How to limit number of channels in sidebar.

Started by hamnawa,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hamnawaTopic starter

How can we limit number of channels in the sidebar also display channels by id, alphabet, number of videos etc.
  •  

PHPVibe A.


hamnawaTopic starter

Another issue I only have Video Channels and they are displaying in all Video/Audio/Images channel. I have imported the videos table from a 3.4 version of the script.

My Sidebar:

<div id="sidebar-wrapper" class="span2 left-sidebar top10 hidden-phone hidden-tablet">
<div id="sidebar"> 
<div class="close-me visible-phone visible-tablet hidden-desktop">
<a id="mobi-hide-sidebar" class="topicon tipN" href="javascript:void(0)" title="<?php echo _lang('Hide'); ?>"><i class="icon-plus"></i></a>
</div>
<?php echo '<div class="searchWidget visible-phone hidden-tablet hidden-desktop" style="margin:10px 6%;">
            <form action="" method="get" id="searchform" onsubmit="location.href=\''.site_url().show.'/\' + encodeURIComponent(this.tag.value).replace(/%20/g, \'+\'); return false;">
                <input type="text" name="tag" id="suggest-videos" value="'._lang("Search videos").'" onfocus="if (this.value == \''._lang("Search videos").'\') {this.value = \'\';}" onblur="if (this.value == \'\') {this.value = \''._lang("Search videos").'\';}" />
             <button type="submit" class="btn btn-primary pull-right"><i class="icon-search"></i></button>
			</form>       
		</div>'
?>
<?php 
//The menu	
echo '<div class="sidebar-nav blc"><div class="head"><h4>'._lang('Video Channels').'</h4></div>'.the_nav().'<div class="clearfix"></div></div>';
if(get_option('musicmenu') == 1 ) {
echo '<div class="sidebar-nav blc"><div class="head"><h4>'._lang('Music Channels').'</h4></div>'.the_nav(2).'<div class="clearfix"></div></div>';
}
if(get_option('imagesmenu') == 1 ) {
echo '<div class="sidebar-nav blc"><div class="head"><h4>'._lang('Image Categories').'</h4></div>'.the_nav(3).'<div class="clearfix"></div></div>';
}
?>
<?php 
$postsx = $db->get_results("select title,pid,pic from ".DB_PREFIX."posts ORDER BY title ASC ".this_limit()."");
 /* The posts lists */
 if($postsx) {
echo '<div class="box"> 
<div class="box-head">
<h4 class="box-heading">'._lang('Latest articles').'</h4>
</div>
	<div class="box-body list">	
	<ul>';
	foreach ($postsx as $px) {
echo '<li><img src="'.thumb_fix($px->pic, true, 23, 23).'"><a href="'.article_url($px->pid, $px->title).'" title="'._html($px->title).'"> '._cut(_html($px->title),19).'</a></li>';

	
	}
echo '<li><i class="icon-folder-close"></i><a href="'.site_url().blog.'" title="'._html($px->title).'"> '._("All articles").'</a></li>';

  echo '  </ul>   
    </div>
    </div>';
}
$pagesx = $db->get_results("select title,pid,pic from ".DB_PREFIX."pages WHERE menu = '1' ORDER BY title ASC ".this_limit()."");
 /* The pages lists */
 if($pagesx) {
echo '<div class="box"> 
<div class="box-head">
<h4 class="box-heading">'._lang('Information').'</h4>
</div>
	<div class="box-body list">	
	<ul>';
	foreach ($pagesx as $px) {
echo '<li><img src="'.thumb_fix($px->pic, true, 23, 23).'"><a href="'.page_url($px->pid, $px->title).'" title="'._html($px->title).'"> '._cut(_html($px->title),19).'</a></li>';

	
	}

  echo '  </ul>   
    </div>
    </div>';
}

?>
</div>
</div>
  •  

PHPVibe A.

Check the upgrade in the pack, the video moving sql commands.

hamnawaTopic starter

I have only moved contents of video and users table everything else is fresh. Do I still need to run the database converter?
  •  

PHPVibe A.

The database converter also contains the split by media types...
You can extract those queries from it.

hamnawaTopic starter

I have worked around this alot without any luck:

I run the queries one by one through PhpMyAdmin same result.

When I execute the 4up5.php I get following error:

ezSQL (v2.17) Debug..
Last Error -- [Duplicate column name 'mtype']

Query [12] -- [CREATE TABLE IF NOT EXISTS `vibe_posts` ( `pid` int(11) NOT NULL AUTO_INCREMENT, `ch` int(11) NOT NULL DEFAULT '1', `date` text COLLATE utf8_swedish_ci NOT NULL, `title` varchar(300) COLLATE utf8_swedish_ci NOT NULL, `pic` longtext COLLATE utf8_swedish_ci NOT NULL, `content` longtext COLLATE utf8_swedish_ci NOT NULL, `tags` varchar(500) COLLATE utf8_swedish_ci NOT NULL, PRIMARY KEY (`pid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=0]

Query Result..

No Results
  •  

PHPVibe A.

You only need this ones

$db->query("Update `".DB_PREFIX."videos` set media = '2' WHERE source like '%.mp3'");
$db->query("UPDATE `".DB_PREFIX."videos` set media = '3' WHERE source like 'localimage%'");


If you run them trough phpmyadmin and your prefix is vibe_ then just run:
Update `vibe_videos` set media = '2' WHERE source like '%.mp3'

and

UPDATE `vibe_videos` set media = '3' WHERE source like 'localimage%'

hamnawaTopic starter

I did run these 2 queries in to PhpMyAdmin. Results same as before no fix.
  •  

PHPVibe A.

Did you clear cache via Tools -> Cache in the backend?

hamnawaTopic starter

  •  

PHPVibe A.

If you did it right, there is no way on earth this would not work.
When you run the queries what does it say?
Are you sure you don't have more tables with different prefixes there?

hamnawaTopic starter

I run these queries with successful results. But the issue not solved I mean video channels are listed in all categories.

Also I do have other tables in the database but I have only restored vibe_videos and vibe_channels to newly installed PhpVibe.


I do have all tables without vibe_ prefix it was used with version 2 or earlier after upgrading to 3.1 the updater converted the db and now I see new updates are listed in the tables with vibe prefix.
  •  

PHPVibe A.

Quote from: hamnawa on
I mean video channels are listed in all categories.

I don't get this, those gueries move videos to types, don't touch channels at all.
If you want to move an type to a specific category you need to run:

For music

Update `vibe_videos` set category = 'insert category id' WHERE media = '2'


For images

Update `vibe_videos` set category = 'insert category id' WHERE media = '3'

hamnawaTopic starter

I apologize as i could not explain it correctly actually i have followed the steps with successful results no error during sql execution the end point same results with same results I mean:

Video Channels
Video Channel 1
Video Channel 2
Video Channel 3

Music Channels
Video Channel 1
Video Channel 2
Video Channel 3

Image Categories
Video Channel 1
Video Channel 2
Video Channel 3


I currently only have videos channels no image or audio and they are displayed under all those categories (video, image, music) in the left.
  •  

hamnawaTopic starter

Hello again,

Just wanted to write that i was able this time to fix this issue but I am facing server down issue as described here: http://www.phprevolution.com/forum/troubleshooting-issues/php-vibe-3-6-crashing-dedicated-server/

The entire server goes down while I browse the website.

Also it is very slow comparing to other website of mine.
  •  

PHPVibe A.

You could have just hidden them from config (images and music channels).
If you removed them by code, you may have broken the code.
That thread has an solution listed.

hamnawaTopic starter

In a new fresh install facing again channel listing have just dropped an e-mail to you guys please have a look.
  •  

PHPVibe A.

Why not send me an message with an link?
I don't have direct access to the pre-sale e-mails, I have to ask the girls every time to look for the mail.

hamnawaTopic starter

I am not able to send you message.

User 'Alexander' has blocked your personal message.
  •  

PHPVibe A.

Try now, forgot to enable them after the vacation.

hamnawaTopic starter

  •  

PHPVibe A.


PHPVibe A.


For slow browsing:
- how many videos do you have?
- Did you check and optimize your database lately?

hamnawaTopic starter

For the images if you browse at the bottom of the page you can see few noimage.png appear in good size but rest of the at the top not.

- The media cache are already writable.
- I currently have 463 videos all embedded from youtube or vimeo.
- I have checked and analyzed the DB if you want you can see for your self I have provided you with cpanel details as well. and the DB tables which I have restored is available in root DB folder.
  •  

PHPVibe A.

I've checked this:


res.php?src=../uploads/1372947300-Atash.png&q=100&w=23&h=23


it outputs the default image.

res.php?src=uploads/1372947300-Atash.png&q=100&w=23&h=23


outputs the actual channel image.

Am I wrong?

hamnawaTopic starter

You are right. Now I have removed all the actual thunmbs it should display noimage in all channels. as you can see in the snapshot it displays the same image (noimage.png) in different size in few channels at the end.

I have re sized the noimage.pnp to 30Pixels.

I noted a difference in channel table structure in PhomyAdmin it shows heading starting from the channels which displays different size image then others.

Can you please have a look at Phpmyadmin your self.
  •  

PHPVibe A.

I noted a difference in channel table structure in PhomyAdmin it shows heading starting from the channels which displays different size image then others.


Can you rephrase this, your English is killing me.

There is no size attached to the thumbnail in the sql.

you can open lib/functions.php and see for yourself:

function the_nav($type=1) {
global $db, $cachedb;
include_once( INC.'/class.tree.php' );
$nav = '';
$tree = new Tree;
$categories = $cachedb->get_results("SELECT cat_id as id, child_of as ch, cat_name as name, picture FROM  ".DB_PREFIX."channels WHERE type='$type' limit 0,10000");
if($categories) {	
foreach ($categories as $cat) {
if($cat->ch < 1) {$cat->ch = null;}
		$label = '<a href="'.channel_url($cat->id, $cat->name).'" title="'. _html($cat->name).'"><img src="'.thumb_fix($cat->picture, true, 23, 23).'" class="cat-menu-img"/>'. _html($cat->name).'</a>';
		$li_attr = '';		
		$tree->add_row($cat->id, $cat->ch, $li_attr, $label);
	}
$nav .=$tree->generate_list();	
}
			
return apply_filters('the_navigation' , $nav);
}

hamnawaTopic starter

I apologize for my poor English. My question about the thumbs is:

One image is used for almost 80% of the channels which is noimage.png.

It is not being displayed in same size for all channels list.

Please see the snapshot attached or scroll down on the website to see channels listed at the end in the left sidebar you may notice the difference your self.
  •  

PHPVibe A.

So, this was the problem.
I have no idea from where this comes, i assume leftover cache file in cache/thumbs/ that didn't get deleted (you should fully empty this folder's content).

Similar topics (7)