jDownloadsownloads.com

Advertisement
Advertisement:

Author Topic: Upload in a pre selected category  (Read 3838 times)

0 Members and 1 Guest are viewing this topic.

Offline leonardo.g

  • Newbie
  • *
  • Posts: 1
Upload in a pre selected category
« on: 07.03.2013 19:08:50 »
Upload in a pre selected category

is possible to add this feature?


is very simple
how to:


in file jdownloads.html.php
after

   $catlist_sel =   $database->getEscaped (JRequest::getInt('catlist', 0 ));

add   

   $catid = intval(JArrayHelper::getValue($_REQUEST, 'catid', 0));      
   if (isSet($catid)) $catlist_sel=$catid;



in file views/upload/tmpl/default.xml

after

   </layout>

add

   <fields name="request">
           <fieldset name="request"
           >
               <field name="catid" type="sql"
                   description="COM_JDOWNLOADS_JD_MENU_CATEGORY_LIST_LABEL1_DESC"
                   extension="com_jdownloads"
                   label="COM_JDOWNLOADS_JD_MENU_CATEGORY_LIST_LABEL1"
                   required="true"
                   query="SELECT cat_id, concat_ws(' / ', cat_title, cat_id) AS title FROM #__jdownloads_cats WHERE published = 1   " key_field="cat_id" value_field="title"
                   default="0"
               >
               <option   value="0">COM_JDOWNLOADS_BACKEND_FILESLIST_CATS</option>
               </field>
           </fieldset>
       </fields>



« Last Edit: 07.03.2013 19:12:19 by leonardo.g »

Offline Arno

  • Administrator
  • ***
  • Posts: 12.110
    • jDownloads.com
Re: Upload in a pre selected category
« Reply #1 on: 28.04.2013 11:40:01 »
Hi,
yes this works. Thanks for this user tip.

In jD 2.5 can you define for every category whether user can upload files in this.

Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!

 

Advertisement