Welcome, Guest. Please login or register.
Did you miss your activation email?

 
Advanced search

22728 Posts in 6695 Topics- by 17594 Members - Latest Member: permsk

22-05-2019 21:59:08
JOOM::GALLERY::FORUMArchiveJoomGallery 1.5 MVCFrontend(bug report) _JOOM_ITEMID in userpanel
Pages: [1]
Print
Author Topic: (bug report) _JOOM_ITEMID in userpanel  (Read 1303 times)
0 Members and 1 Guest are viewing this topic.
chrissy6930
Newbie
*
Offline Offline

Posts: 11


View Profile
« on: 08-04-2010 21:25:51 »

hi there,

in userpanel all links are using the itemID of the userpanel menu link instead of the components or appropriate category link. I think that is caused by the way $itemid is being set up in joomgallery.php

using the currently active itemID works well in viewcategory and viewdetails but not in userpanel. here it should rather be the itemID of the menu link to the respective category (if available) or that of the component link

so far my scrap code is:

Code:
// identify catid of parent cat of logged in user
$db =& JFactory::getDBO();

$db->setQuery(" SELECT cid FROM #__joomgallery_catg WHERE parent='0' AND owner=".$user->get('id')."  ");
$catid = $db->loadResult();

// check if menu link to parent cat exists
$link = JText::_('com_joomgallery&func=viewcategory&catid='.$catid);
$db->setQuery(" SELECT id FROM #__menu WHERE link LIKE '%{$link}%' ");
$catlinkid = $db->loadResult();


// CatsShow
// categorylink
if ($catlinkid) {
$link = JRoute::_('index.php?option=com_joomgallery&func=viewcategory&catid='.$row->cid.'&itemid='.$catlinkid);
} else {
$link = JRoute::_('index.php?option=com_joomgallery&func=viewcategory&catid='.$row->cid.$this->getJoomId());
}
// editlink
if ($catlinkid) {
$link = JRoute::_('index.php?option=com_joomgallery&func=editusercat&catid='.$row->cid.'&itemid='.$catlinkid);
} else {
$link = JRoute::_('index.php?option=com_joomgallery&func=editusercat&catid='.$row->cid.$this->getJoomId());
}


// Userpanel
// titlelink
if ($catlinkid) {
$link = JRoute::_('index.php?option=com_joomgallery&func=detail&id='.$row->id.'&itemid='.$catlinkid);
} else {
$link = JRoute::_('index.php?option=com_joomgallery&func=detail&id='.$row->id.$this->getJoomId());
}

// editlink
if ($catlinkid) {
$link = JRoute::_('index.php?option=com_joomgallery&func=editpic&uid='.$user->get('id').'&id='.$row->id.'&itemid='.$catlinkid);
} else {
$link = JRoute::_('index.php?option=com_joomgallery&func=editpic&uid='.$user->get('id').'&id='.$row->id.$this->getJoomId());
}

I think I'm almost there, will just need to figure out where to go with the top part of these snippets before modifying the functions in joom.userpanel.html.php
« Last Edit: 08-04-2010 22:29:21 by chrissy6930 » Logged
Pages: [1]
Print
Jump to:  

HOSTED BY SCHWARZKÜNSTLER ®

PROTECTED BY  ZB BLOCK  AND Project Honey Pot
Theme orange-lt created by panic

Bad Behavior has blocked 5638 access attempts in the last 7 days.

maternal