Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

[solved] JDownloads -Hide a Module in a Category and the SubCategories

Re: [solved] JDownloads -Hide a Module in a Category and the SubCategories

In Joomla, the official way to do a redirect is this:

$app    = JFactory::getApplication();
$app->redirect("index.php?option=com_comprofiler&task=registers");

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: [solved] JDownloads -Hide a Module in a Category and the SubCategories

I know this code line, but is there a way to code this script by only using "JFactory::getApplication()->redirect("index.php?option=com_comprofiler&task=registers");" once in the script?

Code:

if ($option == "com_search")

JFactory::getApplication()->redirect("index.php?option=com_comprofiler&task=registers");

if ($option == "com_weblinks" and JRequest::getVar("id") == "13")
JFactory::getApplication()->redirect("index.php?option=com_comprofiler&task=registers");

if ($option == "com_jdownloads") {
  $catid = JRequest::getInt("catid", 0);
  $download_id = JRequest::getInt("cid",0);
    if ($catid == 0 and $download_id > 0) {
    $query = "select cat_id from #_".
    $query .= "_jdownloads_files where file_id = " . $download_id;
    $db->setQuery($query);
    $catid =$db->loadResult();
  }
  if ($catid == 4 or $catid == 17)
  JFactory::getApplication()->redirect("index.php?option=com_comprofiler&task=registers");
}

Outbreaker
Beginner Modder
ranks
useravatar
Offline
9 Posts
Administrator has disabled public posting

Re: [solved] JDownloads -Hide a Module in a Category and the SubCategories

sure, try this:

Code:

$redir = false;

if ($option == "com_search")  $redir = true;

else if ($option == "com_weblinks" and JRequest::getVar("id") == "13")  $redir = true;

else if ($option == "com_jdownloads") {
  $catid = JRequest::getInt("catid", 0);
  $download_id = JRequest::getInt("cid",0);
    if ($catid == 0 and $download_id > 0) {
    $query = "select cat_id from #_".
    $query .= "_jdownloads_files where file_id = " . $download_id;
    $db->setQuery($query);
    $catid =$db->loadResult();
  }
  if ($catid == 4 or $catid == 17) $redir = true;
}
if ($redir) JFactory::getApplication()->redirect("index.php?option=com_comprofiler&task=registers");

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: [solved] JDownloads -Hide a Module in a Category and the SubCategories

Thank you a lot for your help i couldn't had done this all without you. smile

Outbreaker
Beginner Modder
ranks
useravatar
Offline
9 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1696
Total Polls:
6
Total Posts:
5941
Posts this week:
7
User Info:
 
Total Users:
5408
Newest User:
obtoc67505
Members Online:
0
Guests Online:
136

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked