Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Panel Order 1.2

13»

Comments

  • Account pictures and attachments (i believe) both add links to the panel for the Administrative Options list on the settings page and I've not yet worked out a sure fire way to avoid adding extensions which *only* do that so you just gotta live with it. Atleast it's not actually missing anything, though.
    Editing the ini file by hand wont achieve anything on its own as the extension files are only rewritten with the new indexes when something is dragged and dropped on the list which the extension displays. That said, if you edit the file by hand it should change the order in which they are displayed on the management page. Can you confirm whether it does that? If it does, can you open up one of the listed default.php files, look for a line which uses $Panel->AddString or $Panel->AddList and see if the index which is assigned in the ini file is an attribute in that function and if not what the attributes are (just paste the line in here). If the index isnt in the attribute, what are the permissions on the file?
  • Ok,

    First I edited the ini file by hand again and yes, it does change the order in which the extensions are displayed on the management page.

    Next, I looked in one of the extension's default.php files. (I used Category Jumper) I found a line that contained $Panel->AddString. I'm not entirely sure what you meant when you mentioned the index which is assigned in the ini file so I'm just posting that section of the default.php file below...
    if (in_array($Context->SelfUrl, array('index.php','comments.php')) && $Configuration['USE_CATEGORIES']) { $Panel->AddString(GetCategoryJumper($Context),2); $Head->AddStyleSheet('extensions/CategoryJumper/style.css'); } ?>

    I'm not sure if that piece of code helps so the permissions for the file are... 6 6 6
  • Right. See the number 2 at the end of the AddString line? That's (presumably) the same index as is in the panelextensions.ini file (open it up and check) which means the extension has done everything it's meant to - it's listed all the extensions which add stuff to the panel, made its config file and indexed them, and then rewritten the extension files with their new indexes to change the order they display in. Why your extensions arent moving is a complete mystery.
    Can you wipe your panelextensions.ini file, load the list, move something, download the panelextensions.ini file from your server, move something else, download it again, and check if there are any differences between the 2 files? If there are would you be able to open up a couple of the default.php files and check that the numbers at the end of the lines (hopefully you understand what i mean now if not i'll try and explain further) correspond with the panelextensions.ini file?
  • I deleted the ini file, moved something and yes, I could see the difference in the order of things. I then went into a few of the extensions' default files and the numbers at the end of the SPanel strings did match up with the ini file.
  • I think there is an excessive need to chmon everything to 777 in vanilla just to make an extension work properly, ideally an extension should not have file permission issues, it should work as is, referring back to the wordpress plugins, they work the moment you activate them no file messing needed, vanilla extensions should be made like this and not interfere with other extensions, I think currently either the vanilla extension system is a bit unstable in that extensions can have conflicts with other extetnsions or, maybe its not the extension system but perhaps in the way the extensions are being made in either case this should be worked out because when you have many extensions in the future its only going to cause havoc on vanilla users accross the globe
  • Well Chris if my extension is correctly writing the extension files with their new indexes then i have absolutely no idea why the extensions arent moving. When the extension code is loaded it uses that index to order itself among the other items in the panel. What the actual number is doesnt really matter as long as it's smaller than something it should be above and bigger than something it should be below. What if you edited some extension files yourself and put some numbers in there like 100 200 300 400 500 over 5 extensions and see if they appeared in the correct order then?

    And bugs, 777 as a file permission is advised because then you can completely rule permissions out as being the reason something isnt working. Once it is working I'd always advise people to cut the permissions down to the lowest possible where it will still work. I believe in this case the extensions only *need* to be set to 666 (or 600 if the extensions are owned by the apache user) as my extension works by rewriting the extension files with a new index to change their placement (in theory). If you have any ideas how I could rewrite files without actually having permission to do so (i.e. so all the files could be left at permission 644) I'd be very interested to hear it. And if you have any ideas how i could change the order of items in the panel without changing the indexes in the function which the extension uses to add itself to the panel I'd also be interested to hear them. I agree that extensions should be designed to interfere with other extensions as little as possible, but in this case it's actually the basic design and theory of the extension that it must interfere with the others in order to do it's job.

    The only other option would be for mark to change the way the $Panel->Add functions work so things using those methods could be edited without actually editing the files but at present that's not possible.
  • Thanks for all the help trying to figure this problem out, Minisweeper. I'll try editing the numbers like you said (100, 200, etc.). If that doesn't do the trick then I'll just have to wait and see if it can be resolved at a later time.

    One more question, If I end up deleting this extension (not that I want to) because it's not working the way I want it, will the order of the sidepanels go back to their default position? Or will I have to do it manually?
  • You'd have to do it manually. At present I dont think there's actually a way for extensions to run removal scripts to tidy up any changes they've made and if there is i've not covered it. Let me know how it goes..
  • Well, after trying all of the things Minisweeper advised me to try I still can't get the order to stay the way I want.
    I'm hoping someone (anyone) can figure out a way to fix this. If not, maybe someone can code a new extension that allows you to do the same thing

    @ Minisweeper - Thanks for all your help.
  • Hi, after install, activate and use this extension, the extension PrivateMessages was deleted off the "extensions" dir. So, I got this message: Parse error: syntax error, unexpected ';' in /home/myuser/public_html/foro/extensions/PrivateMessages/default.php on line 608 I don't know what the problem is, but I have to delete Panel Order en reinstall PrivateMessages extensions. regards, Argie
  • Hmm. I've a feeling it's probably doing that because Jazzman doesn't seem to have put a location identifier on the $Panel->AddString call he uses. Try opening up the PrivateMessages\default.php, locating line 607 (notepad in windows has a go-to line function, most other editors do too), and changing it to:
    $Panel->AddString('<h1><a href="'.GetUrl($Configuration, 'extension.php', '', '', '', '', 'PostBackAction=PrivateMessages&View=SendMessage').'">'.$Context->GetDefinition('SendPrivateMessage').'</a></h1>',99);
  • Ok, thank you. May be I gonna try this hack tomorrow. By the way, is there another way (besides your extension) to reorder the panel ? I've tried moving the lines of /conf/extensions.php but some of my extensions doesn't care it :)
  • The only way is to manually go into each extension file, find a line similar to the one i pasted up there, and change the number at the end of it :) The only way changing the order in conf/extensions.php would work is if 2 extensions share the same location identifier - therefore whichever gets loaded first would win.
  • I was a happy new owner of panel re-order, and just as I enabled it and made the changes I wanted, I was welcomed with this:
    Parse error: syntax error, unexpected ';' in /.../forum/extensions/UserTasks/default.php on line 29
    instead of my forum the moment I went to discussions.

    Aaaaargh!
    This is completely silly! But can't figure it out. Meddling with the mentioned line only brings upon greater disaster. What should I do?
  • Just re-download the user tasks extension and upload it again. It might not be compatable with panel order. I dont have time to check it out now but give me a bump later and i may do.
  • wow... I haven't noticed your answer, not in time at least, but thanks. I sort of went on and found the hard way to solve this... I just got rid of the ";" as the line nicely suggested, and than it showed the same thing for another extension and another and another. So my finger on the backspace, and some 15 minutes and now it works perfectly! 'twas a small price to pay for having my panel look the way I wanted ;)
This discussion has been closed.