Simpledesk placement in profile?

Started by Flavio93Zena, November 19, 2014, 06:45:12 AM

Previous topic - Next topic

Flavio93Zena

Hi all, how to place the SimpleDesk stuff (Helpdesk Profile Preferences Show Tickets Permissions Action Log) below the "Modify profile" column instead of above it? I have seen that the function has been heavily modified and I can't figure it out, plus I also use the awards system by Spuds, no clues on how to put that below the SimpleDesk column, too. Practically now they are "Awards", "SimpleDesk" and then "Modify profile", I would like them to be exactly the opposite...
Thanks in advance :)

venguard223

Exactly the opposite? I don't understand what you mean. Do you mean SimpleDesk then Awards then Modify Profile? Awards, Modify Profile, SimpleDesk?

*shrug* I'll figure it out if I get time, it's been 3+ years since I wrote that code, I don't remember how I did it.

Flavio93Zena

Thanks for your reply :)
I would like it to be "Modify Profile", "SimpleDesk", "Awards" - sorry for not being cristal clear from the beginning.
If you don't remember I can't understand half of it so... :P

venguard223

I have no idea how the Awards mod works, I can only comment on what SimpleDesk does.

Moving SD's profile menu to after Modify Profile is easy enough - Profile.php
// In non HD only, put it before the editing stuff menu
{
foreach ($old_profile_areas as $area => $details)
{
if ($area == 'edit_profile')
$profile_areas['helpdesk'] = $context['helpdesk_menu'];
$profile_areas[$area] = $details;
}
}


Replace with:
// In non HD only, put it before the editing stuff menu
{
foreach ($old_profile_areas as $area => $details)
{
$profile_areas[$area] = $details;
if ($area == 'edit_profile')
$profile_areas['helpdesk'] = $context['helpdesk_menu'];
}
}

Flavio93Zena

#4
Aw *-* that worked indeed! Thanks, it's quite a start :D marking as solved at least for SimpleDesk side!

EDIT: no idea of the reason for it but it says that an error occurred when trying to mark the topic as solved, perhaps you should investigate on this... It *should* have logged something in the error log I think..
In the meantime I will just change the icon to the solved one :P

venguard223

I already know the answer, I just can't be arsed to fix it; SD Team wrote a topic solved mod years ago, we never quite finished it and the permissions check being wrong was one of the things we never fixed in it, lost all motivation to finish things back then.

Flavio93Zena

#6
Perhaps uninstalling it and using Sinan's one? It could be a five-mins and effective solution :) (IIRC it was him making another one...)

Besides I'm going to bed, spent like 8 hours on css today, it's way more than enough >_< at least I'm extremely satisfied with the result. I have email notifications turned on so I won't miss a thing :)

venguard223

I don't have access and to be honest, how low traffic it is around here, it doesn't matter.

Flavio93Zena

I'd have so many questions that would go way OT so I will just thank you and leave it like that :)

Flavio93Zena

For the sake of discussion and for the kindness shown I will post the remaining part of the solution in the remote chance anyone will be reading this in years to come.

/Sources/AwardHooks.php
Code (find) Select

if ($where === 'after')
$position += 1;


Code (replace with) Select

if ($where === 'after')
$position += 2;


Yeah it's easy, but finding it without any kind of help nor knowing how the mod was coded was not easy at all, and in fact I am extremely happy that I made it on my own. :)

venguard223

Going off topic is not usually something that stops you saying things.

Flavio93Zena

I actually posted the remaining part of the solution I was asking for in the OP so it's not OT at all.