Announcement

Collapse
No announcement yet.

How should the Forum PHP widget code be implemented? Different to CMS widget $output?

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

  • [Forum] How should the Forum PHP widget code be implemented? Different to CMS widget $output?

    Hi,

    I have the attached CMS Widget working PERFECT. I want to have that widget working also in the FORUM, so I copy and paste the code to the forum block (php) but it doest not show any result.

    Does it works in the same way this direct php execution in Forum as in CMS widgets?
    Why same widget works on CMS but not in forum php widget?

    Any idea?

    PHP Code:
    ob_start();
    require_once(
    './libros/config.php');
    ... (
    normal query here)

    while(
    $row mysql_fetch_array$words ))  
    {
        
    $same str_replace('-',' ',$row['name']);
        
    $ray SeoString($row['name'],'-');
        
    $output_bits .= '<a href="/libros/'.$ray.'/1/" >'.$same.'</a>, 
                              '
    ;
    }
      
    $output "<div class=box_cuerpo><ul>"$output_bits."</ul></div>";
      
    ob_end_clean(); 

  • #2
    You need to add to the end:
    PHP Code:
    return $output

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools &lt;- awesome site for html/css help

    Comment


    • #3
      Hi Lynne, Thank you so much for your support.

      I added return $output; but still nothing show

      the code looks:

      PHP Code:
      ob_start();
      require_once(
      './libros/config.php');
      ... (
      normal query here)

      while(
      $row mysql_fetch_array$words ))  
      {
          
      $same str_replace('-',' ',$row['name']);
          
      $ray SeoString($row['name'],'-');
          
      $output_bits .= '<a href="/libros/'.$ray.'/1/" >'.$same.'</a>, 
                                '
      ;
      }
        
      $output "<div class=box_cuerpo><ul>"$output_bits."</ul></div>";
        
      ob_end_clean(); 
        return 
      $output
      Is that what you meant?...

      Exact same code is working perfect on CMS widget (without the return $output.

      What is wrong?

      Comment


      • #4
        I think you want to move the return line to right after the output line (before the clean). However, the best place to get support for this is over on vbulletin.org. I know I have seen this discussed several times over there.

        Please don't PM or VM me for support - I only help out in the threads.
        vBulletin Manual & vBulletin 4.0 Code Documentation (API)
        Want help modifying your vbulletin forum? Head on over to vbulletin.org
        If I post CSS and you don't know where it goes, throw it into the additional.css template.

        W3Schools &lt;- awesome site for html/css help

        Comment


        • #5
          Originally posted by Lynne View Post
          I think you want to move the return line to right after the output line (before the clean). However, the best place to get support for this is over on vbulletin.org. I know I have seen this discussed several times over there.
          Hi Lynne. Could you please provide links for similar issues that were already discussed? Not sure if I am using the right keywords but I get no results

          Comment


          • #6
            Search on one of the terms in your code. There are several threads that I get a hit on:
            http://www.vbulletin.org/forum/showt...light=ob_start
            http://www.vbulletin.org/forum/showt...light=ob_start

            Please don't PM or VM me for support - I only help out in the threads.
            vBulletin Manual & vBulletin 4.0 Code Documentation (API)
            Want help modifying your vbulletin forum? Head on over to vbulletin.org
            If I post CSS and you don't know where it goes, throw it into the additional.css template.

            W3Schools &lt;- awesome site for html/css help

            Comment

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