Announcement

Collapse
No announcement yet.

Postbit Templates - added another bit - why does this not work?

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

  • Postbit Templates - added another bit - why does this not work?

    Cheers for that.

    I've added the Postbits/Postbit template to show :



    PHP:--------------------------------------------------------------------------------
    $onlinestatus $post[profile] $post[pmlink] $post[useremail] $post[homepage] $post[search] $post[buddy] $post[gallery]

    --------------------------------------------------------------------------------


    (note the last one)

    I've then created a custom template called Postbit_Gallery.

    However, it's not showing.

    How should I call this template from within the Postbits template?

    (this is an attempt to show the user's Photopost member gallery)

    Cheers,

    Ross

  • #2
    The page itself needs to eval the data into the template Postbit_Gallery then feet the results into $post[gallery]?

    You need it to built the data you're going to want to display, then somewhere in the code you'll have a line that says something like this:

    Code:
    eval("\$post['gallery'] .= \"".gettemplate("Postbit_Gallery")."\";");
    You need to figure out which .php file is building the page you're looking at, figure out where it's building the page, add in the code to pull the data from the database that refers to the gallery, then put that bit above in somewhere.

    Check vbulletin.org, there might be a hack to do what you want, I seem to recall someone doing something simililar and posting it there.

    Kathi

    Comment


    • #3
      Hi,

      Thanks for responding. I actually want to do something a lot simpler than I appear to have come across.

      Basically, I want a button that says "Gallery", which then links to the user's gallery in the Photopost section of my site.

      (eg. http://www.servicepals.com/forums/whateverthread.php --> http://www.servicepals.com/gallery)

      My code for this button is in the Postbit_Gallery template, simply :

      PHP Code:
      <a href="http://www.servicepals.com/cgi-bin/gallery/index.pl?user=$post[userid]">
      <
      img src="http://www.servicepals.com/cgi-bin/gallery/images/gallery4.gif" border="0" alt="View $userinfo[username]'s Gallery"></a

      Just want a Gallery button going next to all the other buttons.

      PLEASE HELP!!!

      Ross
      Last edited by rawnet; Fri 11th Jan '02, 6:49am.

      Comment


      • #4
        Originally posted by Moonwolf
        The page itself needs to eval the data into the template Postbit_Gallery then feet the results into $post[gallery]?

        You need it to built the data you're going to want to display, then somewhere in the code you'll have a line that says something like this:

        Code:
        eval("\$post['gallery'] .= \"".gettemplate("Postbit_Gallery")."\";");
        You need to figure out which .php file is building the page you're looking at, figure out where it's building the page, add in the code to pull the data from the database that refers to the gallery, then put that bit above in somewhere.

        Check vbulletin.org, there might be a hack to do what you want, I seem to recall someone doing something simililar and posting it there.

        Kathi
        That line will have to be in admin/functions.php

        Comment


        • #5
          Hello,

          I'm REALLY confused now.

          Can someone please explain to a really dumb person what I have to do? I tried adding that line to the bottom of my admin/function.php :

          PHP Code:
          if (!$noshutdownfunc) {
            
          register_shutdown_function("doshutdown");
          }
          eval(
          "\$post['gallery'] .= \"".gettemplate("Postbit_Gallery")."\";");

          ?> 
          but the button still doesn't display. All I want is the code below - so that in the Postbit (below each post) it shows a button called gallery4.gif next to all the other buttons. The only thing dynamic is the userID, which should be the same as the UserID of the person which made the post.

          PHP Code:
          <a href="http://www.servicepals.com/cgi-bin/gallery/index.pl?user=$post[userid]">
          <
          img src="http://www.servicepals.com/cgi-bin/gallery/images/gallery4.gif" border="0" alt="View $userinfo[username]'s Gallery"></a
          Please help!!

          Cheers,

          Ross

          Comment


          • #6
            Instead of trying to make a template and change the php file, why don't you just put the link in postbit? Should work fine.

            Comment


            • #7
              What - a - total - plonker.

              Yes - that would do the trick!! Thankyou!! Can't believe I was being so dim. All working fine.

              Many thanks guys - sorry for being so blonde,

              Cheers,

              Ross

              Comment


              • #8
                Originally posted by rawnet
                Hello,

                I'm REALLY confused now.

                Can someone please explain to a really dumb person what I have to do? I tried adding that line to the bottom of my admin/function.php :

                PHP Code:
                if (!$noshutdownfunc) {
                  
                register_shutdown_function("doshutdown");
                }
                eval(
                "\$post['gallery'] .= \"".gettemplate("Postbit_Gallery")."\";");

                ?> 
                but the button still doesn't display. All I want is the code below - so that in the Postbit (below each post) it shows a button called gallery4.gif next to all the other buttons. The only thing dynamic is the userID, which should be the same as the UserID of the person which made the post.

                PHP Code:
                <a href="http://www.servicepals.com/cgi-bin/gallery/index.pl?user=$post[userid]">
                <
                img src="http://www.servicepals.com/cgi-bin/gallery/images/gallery4.gif" border="0" alt="View $userinfo[username]'s Gallery"></a
                Please help!!

                Cheers,

                Ross

                You'll have to add that line in "start build post" section of the functions.php. (around line 60)
                Last edited by okrogius; Fri 11th Jan '02, 4:19pm.

                Comment


                • #9
                  Remember that hacking belongs over at www.vbulletin.org

                  Comment


                  • #10
                    Originally posted by rawnet
                    sorry for being so blonde,
                    Hey! I'm the blonde here right now! This year at any rate

                    Kathi

                    Comment

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