Announcement

Collapse
No announcement yet.

How to insert image block under nav

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

  • How to insert image block under nav

    Hi! I want to put a few image blocks from my G2 installation into my forum under the navbar, before the forum list. I tried pasting the php code into the navbar template, but it wouldn't show up.

    Here's the code:
    Code:
         <?php @readfile('[URL="http://animefanartist.gravitoncity.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title"]http://animefanartist.gravitoncity.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title[/URL]'); ?>
    I've already added the necessary style sheet link in the headinclude. And ideally I'd like to be able to wrap several image blocks in a little bit of html to keep it all neat and organised.

    Any help would be appreciated!
    Graviton City: the Project A-ko Web Site
    http://www.gravitoncity.com
    Anime Imagery
    http://au.groups.yahoo.com/group/animeimagery/

  • #2
    Use a plugin for the PHP code. See this thread.

    Comment


    • #3
      Thanks for the link. I followed those instructions, and they seem to work, except the php is not rendered. I created the plugin as described, defining the variable $g2block and calling the template g2block. I then put the php code in the template, and the $g2block code into the FORUMDISPLAY template. The content of the g2block template is not displayed. If I put simple text into the template, it is rendered, where I would expect it to be, but the php code is not.

      I tried putting the php code (stripped of the <?php and ?>) directly into a plugin at the parse_templates location, and that displayed the result of the php code (a random image block from my G2 gallery) correctly at the very top of the page.

      Can anyone give some further help?

      Thanks
      Graviton City: the Project A-ko Web Site
      http://www.gravitoncity.com
      Anime Imagery
      http://au.groups.yahoo.com/group/animeimagery/

      Comment


      • #4
        I tested this and it works.

        Is your plugin system enabled?

        Admin CP -> vBulletin Options -> Plugin/Hook System

        Comment


        • #5
          Yes, it is enabled. Perhaps I could give you the url and my admin password and you might take a look for me to see what I'm doing wrong?
          Graviton City: the Project A-ko Web Site
          http://www.gravitoncity.com
          Anime Imagery
          http://au.groups.yahoo.com/group/animeimagery/

          Comment


          • #6
            Sure, send me a PM.

            Comment


            • #7
              Your g2block template contains this:

              Code:
              <?php @readfile('http://animefanartist.gravitoncity.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=none');
              ?>
              PHP code does not work in templates.

              I think you want something like this thread.

              Comment

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