[ABD] News Mod

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
wingnut144
Registered User
Posts: 595
Joined: Thu Jan 20, 2005 4:52 pm
Location: Boise, ID
Contact:

Re: [RC] News Mod

Post by wingnut144 » Thu May 22, 2008 7:48 pm

Ok, I've just got some questions on this MOD:
  • It appears there's a config.php file, does this file in the MOD overwrite the config.php file that is set up when PHPBB is installed?
  • Can I pull in messages from a totally different forum? So if Bob has a forum in Australia, can this MOD grab those posts and put them in my forum? Or is that not what its designed to do?
  • Will it run automatically?
  • And how is the <?PHP include("mod.php");?> used to display the postings??

AslanChile
Registered User
Posts: 22
Joined: Sun May 18, 2008 6:10 pm

Re: [RC] News Mod

Post by AslanChile » Fri May 23, 2008 8:53 pm

Demo Page is not available
There is another page ???
Thanks

clutchn
Registered User
Posts: 2
Joined: Fri May 16, 2008 12:09 pm

Re: [RC] News Mod

Post by clutchn » Fri May 23, 2008 9:59 pm

AslanChile wrote:Demo Page is not available
There is another page ???
Thanks
http://www.minitruckin.co.nz Demo Link.


Still searching for a solution to have multiple News include ? Any Ideas?

AslanChile
Registered User
Posts: 22
Joined: Sun May 18, 2008 6:10 pm

Re: [RC] News Mod

Post by AslanChile » Fri May 23, 2008 10:11 pm

Thanks

ecwpa
Registered User
Posts: 107
Joined: Thu Sep 25, 2003 2:13 am
Contact:

Re: [RC] News Mod

Post by ecwpa » Sat May 31, 2008 2:48 am

hello guys, if you want to show the proper forum in urls

add this

Code: Select all

$current_forum = $row['forum_id'];
before

Code: Select all

$current_topic = $row['topic_id'];
then everytime you found

Code: Select all

viewtopic.php?f=1
replace with

Code: Select all

viewtopic.php?f=" . $current_forum . "

i got it almost completely working, the problem is with custom bbcodes and bbcodes inside bbocodes, like

Code: Select all

[color=darkred][size=200]RED[/size][/color]
it appears like this

Code: Select all

[color=darkred">RED[/color">
just like all custom bbcodes

Code: Select all

[spoiler">fsdfdsfasdfd[/spoiler">
any help?
carefull, not english speaker native here

paulbunker
Registered User
Posts: 27
Joined: Tue Nov 27, 2007 5:41 pm
Location: Chester, England
Contact:

Re: [RC] News Mod

Post by paulbunker » Mon Jun 02, 2008 10:56 am

there must be a way of using [stealing] the code for replacing bbcodes that has been written for phpbb? my knowlege isn't good enough to work out which code to borrow and how to get it to work though.

cruddpuppet
Registered User
Posts: 57
Joined: Mon Jan 02, 2006 5:34 am

Re: [RC] News Mod

Post by cruddpuppet » Wed Jun 11, 2008 12:03 am

Sorry peoples for the download issue... I uploaded it to rapidshare. (Host died. D: )

Nitroid
Registered User
Posts: 5
Joined: Sun Jan 29, 2006 6:45 pm
Location: Ohio, USA
Contact:

Re: [RC] News Mod

Post by Nitroid » Wed Jun 11, 2008 3:53 am

Quick question;

Is there any way to display the number of replies for the corresponding thread next to the "Reply / View Comments" link in a news post?

paulbunker
Registered User
Posts: 27
Joined: Tue Nov 27, 2007 5:41 pm
Location: Chester, England
Contact:

Re: [RC] News Mod

Post by paulbunker » Thu Jun 12, 2008 2:04 am

yes there is a comment's link

imperialxt
Registered User
Posts: 27
Joined: Thu Jun 12, 2008 4:09 pm

Re: [RC] News Mod

Post by imperialxt » Fri Jun 13, 2008 1:04 pm

hey i've set it all up and i'm getting this error and i'm just clueless as to whats wrong

Code: Select all

[phpBB Debug] PHP Notice: in file /home/.galleried/bleachxtadmin/bleachxt.com/mod.php on line 54: mysql_num_rows(): supplied argument is not a valid MySQL result resource
[phpBB Debug] PHP Notice: in file /home/.galleried/bleachxtadmin/bleachxt.com/mod.php on line 83: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
here is a copy of my mod.php

Code: Select all

    <?php
      //----------------------------------------------------------------------------//
      // PHPBB3 News Mod V.2.0                                                      //
      //                                                                            //
      // Tested and working on PHPBB3 RC1 - RC5                                     //
      //                                                                            //
      // Added Features:                                                            //
      //   -Choose whether or not to display avatars                                //
      //   -Grab News from multiple forums                                          //
      //   -Seperate and easy to use template file                                  //
      //   -Config file                                                             //
      //   -Character Limit                                                         //
      //                                                                            //
      // MOD Made by Cruddpuppet (http://www.uranet.net/)                           //
      //                                                                            //
      // replace_bb_code() function from bizzar.ssi                                 //
      //                                                                            //
      // Free for editing, but not distribution! If you have any questions on this, //
      // feel free to email me at cruddpuppet@gmail.com !                           //
      //----------------------------------------------------------------------------//

      if(file_exists("config.php")) {
        include("config.php");
        echo "";
      }
      else {
        echo "Config file missing, or incorrect permissions!";
        echo "Stopping the rest of the page from loading!";
        exit();
      }
     
      //Grab news posts with SQL query
      $queryp1 = "SELECT * FROM " . $table_prefix . "posts WHERE forum_id='" . $forum_id[0] . "'";
//$dxx = "SELECT * FROM phpbb3_posts WHERE forum_id='1'";
//$rsult = mysql_query($dxx);
//      while ($row = mysql_fetch_array($rsult)) {
//       echo "<pre>";
//       print_r($row);
//       }

      $queryp2 = "";
      foreach($forum_id as $blaaah) {
        if($blaaah == $forum_id[0]) {
          echo "";
          echo "";
        }
        else {
          $queryp2 .= " OR forum_id='".$blaaah."'";
        }
      }
      $queryp3 = " ORDER BY topic_id DESC, post_id;";
      $query = $queryp1.$queryp2.$queryp3;
      $result = mysql_query($query);
      $num = mysql_num_rows($result);
     
      //following function from bizzar.ssi
      // Find BB code, and replace with desired text. Supported so far: B, I, U, S, URL, IMG, COLOR, QUOTE, CODE
     
      function replace_bb_code($text)
      {
          $text = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $text);
          $text = preg_replace("#\[b\](.+?)\[/b\]#is", "<b>\\1</b>", $text);
          $text = preg_replace("#\[i\](.+?)\[/i\]#is", "<i>\\1</i>", $text);
          $text = preg_replace("#\[u\](.+?)\[/u\]#is", "<u>\\1</u>", $text);
          $text = preg_replace("#\[s\](.+?)\[/s\]#is", "<s>\\1</s>", $text);
          $text = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $text);
          $text = eregi_replace("\\[url=([^\\[]+)\\]([^\\[]*)\\[/url\\]", "<a href=\"\\1\" target=\"_blank\">\\2</a>", $text);
          $text = eregi_replace("\\[img\\]([^\\[]*)\\[/img\\]", "<img src=\"\\1\">", $text);
          $text = eregi_replace("\\[color=([^\\[]+)\\]([^\\[]*)\\[/color\\]", "<font color=\"\\1\">\\2</font>", $text);
          $text = eregi_replace("\\[quote\\]([^\\[]*)\\[/quote\\]", "<br><br><strong>Quote:</strong><table width='80%' border='0' cellspacing='0' cellpadding='3'><tr><td bgcolor='#EFEFEF'><font color='#000000' size='-2'>\\1</font></td></tr></table><br>", $text);
          $text = eregi_replace("\\[code\\]([^\\[]*)\\[/code\\]", "<br><br><strong>Code:</strong><table width='80%' border='0' cellpadding='3' cellspacing='0' bgcolor='#FFFFFF' style='border:1px solid gray;'><tr><td bgcolor='#FFFFFF'><font color='#009900' size='-2'>\\1</font></td></tr></table><br>", $text);
          return $text;
      }
     
      //Array to store the news
      $newsitems = array();
      $one = "1";
     
      //How many posts do you want?
      $newsdisplay = "5";
     
      //Time to get the posts
      while ($row = mysql_fetch_array($result)) {
          //Has the amount of posts to be displayed been reached?
          if ($one <= $newsdisplay) {
              //Set some variables for future reference
              $current_topic = $row['topic_id'];
              $current_post_id = $row['post_id'];
              $current_subject = $row['post_subject'];
             
              //Query the database for the username from the user id
              $useridquery = "SELECT * FROM " . $table_prefix . "users WHERE user_id='" . $row['poster_id'] . "';";
              $useridresults = mysql_query($useridquery);
              $useridrow = mysql_fetch_object($useridresults);
             
              //Has the subject already been posted?
              //If so, do nothing
              //The first post is the original, so we have nothing to worry about
              if (in_array($current_topic, $newsitems)) {
                  echo "";
                  echo "";
              } else {
                  //Hmm... It's not in the array, so we'll put it there so it's not repeated
                  array_push($newsitems, $row['topic_id']);
                 
                  //Extra parsing where bbcode function doesn't parse
                  $message = str_replace("\n", '<br />', replace_bb_code($row['post_text']));
                  $message = str_replace("[size=", "<font size=\"", $message);
                  $message = str_replace("[url=", "<a href=\"", $message);
                  $message = str_replace("[/size]", "</font>", $message);
                  $message = str_replace("[/url]", "</a>", $message);
                  $message = str_replace("[marquee]", "<marquee>", $message);
                  $message = str_replace("[/marquee]", "</marquee>", $message);
                  $message = str_replace("]", "\">", $message);
                  $message = str_replace("jpg\">", "jpg\" alt=\"\" />", $message);
                  if($charlimit > 0) {
                    if(strlen($message) > $charlimit) {
                      $message = substr($message,0,$charlimit) . "...<a href=\"/" . $forumpath . "/viewtopic.php?f=1&t=" . $current_topic . "\">(read more)</a>";
                      echo "";
                    }
                  }
                  else {
                    $message = $message;
                    echo "";
                  }

                  //get variables ready for template
                 
                  $posterlink = '<a href="/'.$forumpath.'/memberlist.php?mode=viewprofile&u='.$row['poster_id'].'\">'.$useridrow->username.'</a>';
                  $postdate = date('l dS \of F Y h:i:s A', $row['post_time']);
                  $replylink = "<a href=\"/" . $forumpath . "/posting.php?mode=reply&f=1&t=" . $current_topic . "\">Reply</a>";
                  $viewlink = "<a href=\"/" . $forumpath . "/viewtopic.php?f=1&t=" . $current_topic . "\">Replies/Comments</a>";

                  $avatar = '<img src="/'.$forumpath.'/download.php?avatar='.$useridrow->user_avatar.'" alt="" />';

                  //load + use template
                  if(file_exists("template.html")) {
                    $template = file_get_contents("template.html");
                    $template = str_replace("{subject}", $current_subject, $template);
                    $template = str_replace("{posterlink}", $posterlink, $template);
                    $template = str_replace("{postdate}", $postdate, $template);
                    $template = str_replace("{message}", $message, $template);
                    $template = str_replace("{replylink}", $replylink, $template);
                    $template = str_replace("{viewlink}", $viewlink, $template);
                    if($showavatars) {
                      $template = str_replace("{avatar}", $avatar, $template);
                      echo "";
                    }
                    else {
                      $template = str_replace("{avatar}", "", $template);
                      echo "";
                    }
                    echo $template;
                  }
                  else {
                    echo "Template file not found! Stopping Execution of the rest of the page :(";
                    exit();
                  }
                  //Time to make sure that the amount of news posts to be displayed will be reached.
                  $one++;
              }
          }
      }
    //credits (You are welcome to take this line out, but I would rather you didn't, so more people can find this mod)
    echo('PHPBB3 MOD by <a href="http://www.uranet.net/">cruddpuppet</a>');
    ?>

Nitroid
Registered User
Posts: 5
Joined: Sun Jan 29, 2006 6:45 pm
Location: Ohio, USA
Contact:

Re: [RC] News Mod

Post by Nitroid » Sun Jun 15, 2008 7:06 pm

paulbunker wrote:yes there is a comment's link
No, that's not what I'm asking--

I know there's a link to the comments, but is there any way to display the amount of comments posted on the news page?

circpros
Registered User
Posts: 61
Joined: Sun Mar 07, 2004 5:38 am

Re: [RC] News Mod

Post by circpros » Sun Jun 15, 2008 7:51 pm

How do yo download the mod? Rapidshare asks you to enter 7 symbols in the captcha box, but only allows 4 characters.....

?????

imperialxt
Registered User
Posts: 27
Joined: Thu Jun 12, 2008 4:09 pm

Re: [RC] News Mod

Post by imperialxt » Sun Jun 15, 2008 8:33 pm

read the captcha question more carefully they ask for u to find 4 certain types of characters in the captcha

circpros
Registered User
Posts: 61
Joined: Sun Mar 07, 2004 5:38 am

Re: [RC] News Mod

Post by circpros » Sun Jun 15, 2008 8:41 pm

I saw that - it says 'connected to a cat'. They are all connected to a cat!

circpros
Registered User
Posts: 61
Joined: Sun Mar 07, 2004 5:38 am

Re: [RC] News Mod

Post by circpros » Sun Jun 15, 2008 8:43 pm

Er.... okay..... I guess some were very fuzzy dogs. That's some of the most difficult to red captcha text I've ever seen!

Locked

Return to “[3.0.x] Abandoned MODs”