Related Topics


What file would you go to in order for require category on all uploads?  (Read 1842 times) Print

1 B


dbristylez0831  May 07, 2016, 07:58:27 PM

I was wondering what file that would be and which line? Where would the file be located exactly? And I also wanted to change the form as well.

Logged


dbristylez0831  May 07, 2016, 08:22:25 PM

Oh and my icons are out of control. Everytime something is shared somewhere like facebook it shows the wrong picture. Like I just shared a models picture and it posted another models picture.

Logged


yafe3  May 07, 2016, 10:04:03 PM

This a good question  i was wondering  the same,some people  they don't  choose  a category  they mess the  looking system

Logged


dbristylez0831  May 08, 2016, 05:19:49 AM

This a good question  i was wondering  the same,some people  they don't  choose  a category  they mess the  looking system

Maybe we will get an answer Monday. But if I find out I will let you know.

Logged


@Mario  May 08, 2016, 04:50:09 PM

com/com_add.php
com/com_share.php

You simply have to add required="" to the select .

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


dbristylez0831  May 08, 2016, 06:08:17 PM

Ok thanks Mario.

Logged


dbristylez0831  May 08, 2016, 07:14:19 PM

Check line 140 I did as you said but everytime I try it, it doesn't work. I try to leave the category blank and it still uploads. Really now it doesn't require you to put anything at all not even a title. But it started doing that even before I changed the code. I know that you are busy with others but when you get a chance in that com/share.php I was wondering what would have to change in that file so i can set a universal icon for sharing and also users that do not upload a image to the content they upload?

Logged


@Mario  May 09, 2016, 04:18:05 PM

No, no

Look at the function

Code
function cats_select($name = null, $class= "select", $validate ="validate[required] form-control", $type="1"){

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


@Mario  May 09, 2016, 04:21:22 PM

My bad, here is a fix for this:

Change in functions.php lines 1859 to 1867 (caution with line numbers, they may vary based on software used)

Code
/* Channels dropdown builder */
function cats_select($name = null, $class= "select", $validate ="required", $type="1"){
global $cachedb;
$sub = '';
$data = '';
if(!is_moderator()) { $sub ="AND sub > 0";}
$categories = $cachedb->get_results("SELECT cat_id as id, cat_name as name, child_of as ch  FROM  ".DB_PREFIX."channels WHERE type = '".$type."' ".$sub." order by cat_name asc limit 0,10000");
$data =' <select placeholder="'._lang("Select channel:").'" name="'.$name.'" class="'.$class.' form-control" '.$validate.'> ';
if($categories) {

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


@Mario  May 09, 2016, 04:30:11 PM

After that in

com/com_share.php (for link share) change:

Code
'.cats_select('categ','select',' form-control',$mt).'
to

Code
'.cats_select('categ','select','required',$mt).'


But, as I've noticed doing this steps, even if the required tag exists, the validation for jquery is not passed, as it's being canceled by the select2 jquery plugin.

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!