• Welcome to PHPVIBE Forums. Please log in.

What file would you go to in order for require category on all uploads?

Started by dbristylez0831,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dbristylez0831Topic starter

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.
  •  

dbristylez0831Topic starter

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.
  •  

yafe3

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

dbristylez0831Topic starter

Quote from: yafe3 on
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.
  •  

Marius P.

com/com_add.php
com/com_share.php

You simply have to add required="" to the select .
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

dbristylez0831Topic starter

  •  

dbristylez0831Topic starter

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?
  •  

Marius P.

No, no

Look at the function

function cats_select($name = null, $class= "select", $validate ="validate[required] form-control", $type="1"){
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

Marius P.

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)

/* 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) {
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

Marius P.

After that in

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

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

to

'.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.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

Similar topics (6)