[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.
cruddpuppet
Registered User
Posts: 57
Joined: Mon Jan 02, 2006 5:34 am

Re: [RC3&RC4] News Mod

Post by cruddpuppet »

You can put it anywhere actually (If you want to be xhtml compliant, it would belong in the <head></head> section of the site)

Just put this:

Code: Select all

<style type="text/css">
your css
</style>
in the <head></head> section of your site.
Mike Tha Munsta
Registered User
Posts: 14
Joined: Thu Apr 12, 2007 1:05 am

Re: [RC3&RC4] News Mod

Post by Mike Tha Munsta »

great mod ive been waiting a while for this :)
User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Seattle, WA
Name: David Lewis
Contact:

Re: [RC3&RC4] News Mod

Post by Highway of Life »

Please use the correct topic title. i.e. RC3&RC4 is not a valid topic title.
The prefix you use should be the release cycle your MOD is currently in. For example [DEV], [ALPHA], [BETA], [RC] etc. are valid prefixes.

Also, you should provide a download link for your MOD instead of embedding it, and your post should follow along the lines of the Modification Topic Starter Template.

Please see MOD Development Forum Rules for more details. :)

On a side note and as a suggestion, you should use the supplied phpBB3 DBAL system instead of hard-coding mysql() functions, and it should also follow the Coding Guidelines for everything else. -- especially if you are planning to submit it to the MOD Database anytime in the future. ;)
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.
cruddpuppet
Registered User
Posts: 57
Joined: Mon Jan 02, 2006 5:34 am

Re: [RC3&RC4] News Mod

Post by cruddpuppet »

Ah, sorry. What is this 'DBAL' ?
User avatar
thelinx
Registered User
Posts: 230
Joined: Sat May 26, 2007 9:17 am
Name: Linus

Re: [RC3&RC4] News Mod

Post by thelinx »

DataBase Abstraction Layer.
cruddpuppet
Registered User
Posts: 57
Joined: Mon Jan 02, 2006 5:34 am

Re: [RC3&RC4] News Mod

Post by cruddpuppet »

I don't see what's wrong with my current method, in the end, the database is still being connected to, information still being extracted.
User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Seattle, WA
Name: David Lewis
Contact:

Re: [RC] News Mod

Post by Highway of Life »

  1. The first and obvious reason is that if you don’t use the DBAL, it only works with the Database type you specified in your file, in this case, only MySQL.
    phpBB3 DBAL supports 8 DBMS types (Database types, such as Oracle, Firebird, SQLite, PostgeSQL, MSSQL, etc). So by not using the DBAL, you are severely limiting you users ability to use their own database type with your MOD. -- There will also be compatibility problems with different MySQL versions if you don’t use the phpBB3 DBAL.
  2. The second reason is that we will not approve or validate a MOD that is not programmed using the phpBB DBAL system, for phpBB2 or phpBB3. MODs that do not use the phpBB DBAL system qualify for the Insta-deny criteria. It is the required method of coding for phpBB3 per the Coding Guidelines.
  3. Third, you’re specifying connection information that has already been specified once before. Its not utilizing the flexibility and integration of phpBB3, which it should (and is also required if its going to be submitted to the MOD Database). All configuration values must be handled through the UI (User Interface) of the ACP (Administration Control Panel), and therefore hard-coding them is not desired.
  4. The Fourth reason is that its safer. -- This is the biggest issue. -- The DBAL has already been programmed with security in mind, so you have a much better chance of having an accidental security hole in your MOD/code if you do not use the phpBB DBAL system.
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.
saz3rx
Registered User
Posts: 181
Joined: Wed Jul 18, 2007 3:22 pm

Re: [RC3&RC4] News Mod

Post by saz3rx »

cruddpuppet wrote:First of all, if you're using a free phpbb forum (free as in invisionfree.com is for IPB) it won't work.

Let's start off here.
$dbms = 'mysql';
$dbserver = 'localhost';
$dbport = '';

Leave those three alone, unless your host specifies otherwise.

$dbname = 'Database Name';
$dbuser = 'Database Username';
$dbpasswd = 'Database Password';

Replace the proper information in the proper spot. If your database name was 'phpbb_db', then you would replace 'Database Name' with 'phpbb_db'.

Same for the username, and password.

$table_prefix='phpbb3_'

phpbb3 is the default one, so if you don't remember what you put, then use that. It's the same one you used at installation.

If you want the comments/replies links to work, then you have to set the following variable correctly:

$forumpath = "nforum";

On the demo site, the script was on 'http://www.n-etwork.com/' and the forum was at 'http://www.n-etwork.com/nforum'. The forum path would then be 'nforum'.

Last thing to be modified, is forum id.

$forum_id = "1";

That was what I used because my news forum is the first, with the id being 1. you can easily get the forum id from the url of the section you want to get the posts. If my url was viewforum.php?f=4, then my $forum_id should equal "4".

If you need me to go in-depth with anything else, just ask.
After making the changes I just run the php file and it will do the needful?
hsiehstanley83
Registered User
Posts: 142
Joined: Sun Feb 11, 2007 8:08 am

Re: [RC3&RC4] News Mod

Post by hsiehstanley83 »

saaiberke wrote:
NicknameHere wrote:Also, just to clarify, to use this mod, replace everything CP just went into detail with then use an include on the page you want the news to show on, like so:

Code: Select all

<?PHP
include("http://yoursite.com/news.php");
?>	
yoursite.com being whatever domain you're using and news.php being the mod under whatever name you saved it as.
This doesn't seem to work on my website. So I created a test.html with

Code: Select all

<?PHP
include("http://mydomain/forum/news.php");
?>	
in it but nothing show up. When I go directly to http://mydomain/forum/news.php I see the postings that I want.

Any clue on this please?

Grtz,

Nic
Instead of creating "test.html," try test.php ;)
saaiberke
Registered User
Posts: 1126
Joined: Wed Jul 20, 2005 8:13 am
Location: Gent/Belgium
Contact:

Re: [RC] News Mod

Post by saaiberke »

I just added a <font=> before the "message" in news.php for now and the output on the website is ok. Later I will check how to put it in a css. ;)

Thank you all for the advice and help on this, it is working great now :)

Grtz,

Nic
saz3rx
Registered User
Posts: 181
Joined: Wed Jul 18, 2007 3:22 pm

Re: [RC] News Mod

Post by saz3rx »

saaiberke wrote:I just added a <font=> before the "message" in news.php for now and the output on the website is ok. Later I will check how to put it in a css. ;)

Thank you all for the advice and help on this, it is working great now :)

Grtz,

Nic
Can I have a link to your forum to see the preview of the MOD :)?
RogueDOC
Registered User
Posts: 1
Joined: Wed Jan 04, 2006 5:15 pm

Re: [RC] News Mod

Post by RogueDOC »

Is there a way to pull news from multiple forums on the board?
saaiberke
Registered User
Posts: 1126
Joined: Wed Jul 20, 2005 8:13 am
Location: Gent/Belgium
Contact:

Re: [RC] News Mod

Post by saaiberke »

I see that in the script BBcode is being replaced but I have made a custom BBcode that I also want to be replaced:

Code: Select all

[c]{TEXT}[/c]
Which gives this:

Code: Select all

<span style="background-color:{#10f74c};">© {TEXT}</span>
How can I get it replaced so it shows:

Code: Select all

© text

on the output page?

Thx,

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

Re: [RC] News Mod

Post by cruddpuppet »

Well, I was originally going to use the function that phpbb uses when parsing a post for bbcode, but whenever I try using it, it gives me an error, so I just resorted to str_replace and a pre-existing function as a workaround without really considering custom bbcode. I'll see if I can get it working.
cruddpuppet
Registered User
Posts: 57
Joined: Mon Jan 02, 2006 5:34 am

Re: [RC] News Mod

Post by cruddpuppet »

Does anyone know where avatars are stored in the database for a user?
Locked

Return to “[3.0.x] Abandoned MODs”