Announcement

Collapse
No announcement yet.

Question on PHP Syntax used in AdminCP/Index.php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    CarCdr:

    I've now had a chance to re-run my experiment on the adminCP file, this time using an editor which will show me white spaces, to ensure no such errors. And making sure there were no white spaces, I retried replacing each of the '<br />' entries, one at a time, with '|'; saving the file; restarting the "server'; and trying the adminCP. This time (because there were no white space errors) the adminCP worked as you said it would, each time, no matter how many of the '<br />' were changed to '|'.

    So the only question left, which was really the one I started with, is how does vBulletin explain the different usage, and are they related to different versions of php and/or xml and/or xhtlm. All of this would have been so easy if my search on the net had found a reference discussing the '|' symbol, but so far I have not found one. Certainly as you explained, and as my (properly performed) tests revealed, they both appear to cause a line break in the output display.

    [Edit: And as to your code edit, to give the "Show All Users", in v3.0.3 the line you describe, to find the place to add the line, starts at Line 664. Adding the line:

    construct_nav_option('List All Users', 'user.php?do=find');

    worked completely, but raises another take on the previous question. The line you added ends with NEITHER a '<br />' NOR an '|', so one would be left to assume that, at least in this case, NEITHER of them is required. ]

    [Edit2: Of course, in v3.0.3, there is already a "Show All Users" in the "Quick Search" menu at the top of the 'Search for Users" option selection.]

    Thanks for your assistance and patience.

    Regards,
    Last edited by slappy; Mon 26th Jul '04, 9:49am.
    Slappy

    Comment


    • #17
      I didn't bother reading through all of this, but could it be that the idea behind all this was maybe to allow two menu entries on *one* line. I think there was something like that in vb" already, not?
      Best Regards
      Colin Frei

      Please don't contact me per PM.

      Comment


      • #18
        Which suggests why reading through the whole thread might shead light on the issue. Simply put, the question was why did these lines end in different symbols when they each appeared in a separate menu option box in the "Users" section of the adminCP.

        PHP Code:
        construct_nav_option($vbphrase['add_new_user'], 'user.php?do=add''|');
        construct_nav_option($vbphrase['search_for_users'], 'user.php?do=modify''|');
        construct_nav_option($vbphrase['merge_users'], 'usertools.php?do=merge''|');
        construct_nav_option($vbphrase['ban_user'], "../$modcpdir/banning.php?do=banuser"'<br />');
        construct_nav_option($vbphrase['prune_users'], 'user.php?do=prune''|');
        construct_nav_option($vbphrase['private_message_statistics'], 'usertools.php?do=pmstats''<br />');
        construct_nav_option($vbphrase['referrals'], 'usertools.php?do=referrers''|');
        construct_nav_option($vbphrase['search_ip_addresses'], 'usertools.php?do=doips''<br />');
        construct_nav_option($vbphrase['view_banned_users'], "../$modcpdir/banning.php?do=modify"'<br />');
        construct_nav_option($vbphrase['send_email_to_users'], 'email.php?do=start''|');
        construct_nav_option($vbphrase['generate_mailing_list'], 'email.php?do=genlist''<br />');
        construct_nav_option($vbphrase['access_masks'], 'accessmask.php?do=modify''<br />');
        construct_nav_group($vbphrase['users']);

        Through CarCdr's knowledge of the proper functioning of "functions" and my empirical tests, we confirmed that the endings '<br />' and '|' made no difference in the appearance and fuctionality of the menu options at all and that menu options appeared to work equally well without either symbol at the end of a line, if there was a ); to terminate the line.

        What we have not discovered or been told is WHY vBulletin intermixes these two variations at the ends of the lines within the adminCP/index file, but we are surmising that it may most likely be the simple failure to completely edit the file for consistency.

        Regards,
        Slappy

        Comment


        • #19
          And I'm not contradicting anything you just wrote, but adding to it.

          Like I said, my opinion for the use of this is (was) to allow more than one Link an a line.
          It may be used in future versions, but may also be a leftover bit from vB2.

          Hope that's clearer
          Best Regards
          Colin Frei

          Please don't contact me per PM.

          Comment


          • #20
            Yep. That's clearer, it's just that all of these have only one entry per line and they end with two different symbols. This is true of many other entries in this particular file and my guess is that one or the other is, indeed, left over from vB2 and the files weren't edited to make them all consistent.

            With this structure, two entries per line does not seem doable and there is little space for such entries.

            [Edit: I've now taken a look at the adminCP/index file in version v2.3.0 and it also uses a mix of the two symbols for ending the lines. So maybe we need a vBulletin answer as to why. ]

            Regards,
            Last edited by slappy; Sun 25th Jul '04, 10:47pm.
            Slappy

            Comment


            • #21
              Originally posted by slappy

              [Edit: I've now taken a look at the adminCP/index file in version v2.3.0 and it also uses a mix of the two symbols for ending the lines. So maybe we need a vBulletin answer as to why. ]

              Regards,

              I wonder if the Devs are watching this thread while chuckling behind their hands...

              Certainly, if one of them would like to shed some light on this - I don't think any of us would mind... At this point, I think this puzzle has become something like a sore tooth, that you can't help but keep prodding every now and then.
              echo $ocean_signature;

              ;)

              Comment


              • #22
                Geez!

                For awhile, the admincp links would allow multiple items on one line. The pipe, |, was the character that seperated the items. Specifying a <br /> would, of course, send the text to the next line.

                At some point, Kier, decided to put everything on one line and he changed $extra to $_extra to effectively ignore the extra setting without removing the code, in the event he wished to revert. That third paramater can be deemed useless at this point and I'll remove it.

                Comment


                • #23
                  Thanks Freddie for the "official" word.

                  In the companion Thread, started by Ocean in the "How Do I" forum, Mystic from the vBG team also "piped in" (bad pun intended) and stated essentially the same thing:

                  Actually it's a relict of vB2 / the old admin cp style. "|" and "<br />" used to be the seperator between two nav links. But now all links start in a new line, so this is no longer used anywhere.
                  He, also, confirmed what is mentioned above, that leaving either or both of them off and ending the line with a simple " ); " will result in no visual difference in the navbar." You have also confirmed, for those who might not have completely understood CarCdr's discussion of the "why" they are ignored, that it is because the change in the use of "$extra to $_extra," which defines how this functions of the navbar responds (found in "includes\adminfunctions_navpanel.php", not "adminCP/index.php") forces php to "effectively ignore the 'extra' setting without removing the code".

                  And to sum up, for those who might not want to read this whole thread (or it's confused parts) this is because, as CarCdr stated, "adminfunctions_navpanel.php" defines $extra, (function construct_nav_option($title, $url, $extra = '') which "creates an <option> or <a href for the left-panel of index.php," but does not define "$_extra." So when the code reaches the line (line 60 in 3.0.3) "$options[] = "\t\t<div class=\... ... <a href=\"$url$sessionlink\"$bubblefix>$title</a>$_extra</div>\n" the "$_extra" doesn't cause anything "$extra" to happen.

                  And the reason I failed to recognize "|" as the Pipe symbol is I last used it in DOS and there, if I remember back that far, it was displayed as "¦" with a break in the middle of the line, but that's probably just the html version. Using shift + \ on the keyboard gives the '|' Pipe symbol shown in the php code. (Doh!)

                  Thanks again to everyone for their patience and clearing all of it up.

                  Regards,
                  Last edited by slappy; Mon 26th Jul '04, 1:22pm.
                  Slappy

                  Comment


                  • #24
                    Originally posted by Freddie Bingham

                    Geez!

                    You must have really enjoyed reading this thread on a Monday... <grin>

                    Thanks for helping to clear this up, I'm sure you've made a lot of people gain closure, if not feelings of outright vindication.


                    Thank you, everyone, for helping with this!
                    echo $ocean_signature;

                    ;)

                    Comment

                    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                    Working...
                    X