We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29319
    • 37 Posts
    Hi guys, okay i have this snippet

    [[ssi]]
    <?php
    error_reporting(E_ALL);
    
    require("/home/syfkarma/public_html/tarleton/forums/SSI.php"); 
    $array = ssi_recentTopics( 3, null, 'array');
    foreach ($array as $post)
    {
      echo $post['subject'], '<br />';
    }
    ?>
    ?>



    Which is called in this code
    				
    <div class="block recent-threads">
    <h3 class="block-title"><span>Recent Forum Threads</span></h3>
    <ul class="list-threads">
    <li><a href=/forums/ title="View Latest Post">[[ssi]]</li>
    </ul>


    So atm the code looks like tarleton.syfgaming.com.au (LATEST FORUM TOPICS). Im trying to work out how to format like this
    <li><a href=/forums/ title="View Latest Post">Topic 1</li>
    <a href=/forums/ title="View Latest Post">Topic 2</li>


    how can i do this? CAN i do this? DO you understand what i’m asking tongue
      • 22840
      • 1,572 Posts
      Not a expert in PHP but would it not be something like:

      <?php
      error_reporting(E_ALL);
      
      require("/home/syfkarma/public_html/tarleton/forums/SSI.php"); 
      $array = ssi_recentTopics( 3, null, 'array');
      foreach ($array as $post)
      {
        echo '<li>'/n;
        echo $post['subject'], '<br />';
        echo '</li>'/n;
      }
      ?>


      AND

      <div class="block recent-threads">
      <h3 class="block-title"><span>Recent Forum Threads</span></h3>
      <ul class="list-threads">
      <a href=/forums/ title="View Latest Post">[[ssi]]
      </ul>


      As I say i’m no expert but it looks like it would work lol
        • 29319
        • 37 Posts
        ok thats strange get the follow error

        « MODx Parse Error »
        MODx encountered the following error while attempting to parse the requested resource:
        « PHP Parse Error »
         
        PHP error debug
          Error: 	Division by zero	 
          Error type/ Nr.: 	Warning - 2	 
          File: 	/home2/webhostr/public_html/assets/snippets/jots/includes/jot.db.class.inc.php	 
          Line: 	760	 
          Line 760 source: 	$sr_rat= round($valid_s/$valid_n); 	 
         



        Somthing is stuffing it up in the snippet.....i dont really understand what.
          • 22840
          • 1,572 Posts
          Wierd as that error is from Jot

          Try this:

          <?php
          error_reporting(E_ALL);
          
          require("/home/syfkarma/public_html/tarleton/forums/SSI.php"); 
          $array = ssi_recentTopics( 3, null, 'array');
          foreach ($array as $post)
          {
            echo '<li>'$post['subject'], '</li>';
          }
          ?>


          As I said I’m no expert in PHP so just try playing with the echo value to see what you get
            • 29319
            • 37 Posts
            Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' 


            Hmm line 7, ill have a play
              • 22840
              • 1,572 Posts
              Right it may not like the new line in PHP so try :

              <?php
              error_reporting(E_ALL);
              
              require("/home/syfkarma/public_html/tarleton/forums/SSI.php"); 
              $array = ssi_recentTopics( 3, null, 'array');
              foreach ($array as $post)
              {
                echo '<li>';
                echo $post['subject'],;
                echo '</li>';
              }
              ?>
                • 29319
                • 37 Posts
                Ledgend Absolute ledgend.
                  • 22840
                  • 1,572 Posts
                  So which one worked ??

                  Also change your snippet to this as I forgot to close the a

                  <div class="block recent-threads">
                  <h3 class="block-title"><span>Recent Forum Threads</span></h3>
                  <ul class="list-threads">
                  <a href=/forums/ title="View Latest Post">[[ssi]]</a>
                  </ul>
                    • 29319
                    • 37 Posts
                    The last one. bit off topic however do u know much about SMF sii?
                      • 22840
                      • 1,572 Posts
                      Nothing at all, prefer IPB myself grin

                      Edited the post above as you were posting so have a look