1
yellowchimp
order of links in shortcut menu

Hi

Does anyone know how to change the order of the links in the shortcut menu. I am using module icontent and the links inteh shortcut menu automatically fall into alphabetical order. Does anyone know how to change this?

Many thanks

2
yellowchimp
Re: order of links in shortcut menu

just to add a bit more information for anyone who might be able to help me:

The shortcuts menu in icontent is a block.
I got this php code from the file b.icontent.shortcuts.
I think maybe somewhere in here it must stipulate the order the links are listed in??? Maybe..Possibly??




function b_icontent_shortcuts($options)
{
global $xoopsDB, $xoopsConfig;

$myts =& MyTextSanitizer::getInstance();
$block = array();
$block['shortcut'] = array();

$result = $xoopsDB->query("SELECT `name`, `page` FROM `".$xoopsDB->prefix()."_icontent_shortcuts` ORDER BY `name`");
if (mysql_num_rows($result) > 0)
{
while($item = $xoopsDB->fetchArray($result))
{
$item['name'] = $myts->makeTboxData4Show($item['name']);
if(strlen($item['name']) > $options[0])
{
$item['name'] = substr($item['name'],0,$options[0])."...";
}
$block['shortcut'][] = array('name' => $item['name'], 'link' => XOOPS_URL."/modules/icontent/index.php?page=".$item['page']);
}
$block['content'] = 1;
}
else
{
$block['content'] = 0;
$block['lang_noShortcut'] = _IC_B_NOSHORTCUT;
}

return $block;
}

function b_icontent_shortcuts_edit($options)
{
$form = _IC_B_NAMELENGTH." :  "._IC_B_CHARS."\n";

return $form;
}
?>



I don't know php so can''t read it

3
yellowchimp
Re: order of links in shortcut menu

You need to go into the database and go to the table xoops_icontent_shortcuts. Click on browse to see all your shortcuts. You will notice a column called submenu and that every shortcut has been given the number '1'.
Click on the edit thing (little pen thing to the right of each shortcut). Give each shortcut a new submenu number - 1 being the link you want to appear at the top of your menu, 2 second and so on). (click on 'go' each time to save the new submenu number).

Then in a html editor (i used homesite) open up the file b_icontent_shortcuts.php (from within the blocks folder of icontent).

Near the top of the page there is a line of code that says this:

$result = $xoopsDB->query("SELECT `name`, `page` FROM `".$xoopsDB->prefix()."_icontent_shortcuts` ORDER BY `name`");

All you have to do now is change the word 'name' AT THE END OF THE CODE LINE for 'submenu'.

save it and ftp it across to replace the old one.

Hope thathelps somebody - I've wasted a lot of hours trying to figure that out.

Login

Who's Online

291 user(s) are online (201 user(s) are browsing Support Forums)


Members: 0


Guests: 291


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits