MOTD in PHPBB

phpBB integration forum

MOTD in PHPBB

Postby PazzeKahl » Sat Sep 16, 2006 10:50 pm

Hi @ll

I want to put the motd of the guild in the header of the phpbb forum! well i can do that by adding

Code: Select all
<img src="http://domain.com/roster/motd.php?motd=gildmessage">


in the overall_header.tpl, but than ive to rewrite the message everytime myself when it changes! it might look kinda nice if u want to have a custom one in ur forum, but i would like that it takes the motd which is saved in the databes, just like in the roster! i looked through the files to find out how its done there, but couldnt find anything, how its integrated there!
already thanks for help

Heres the link to the Forum i want to have the motd in, right now i did it like i descriped above with writing it myself

http://cerberus-forum.de.vu/

mfg Pazze
PazzeKahl
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Sat Sep 16, 2006 10:41 pm

MOTD in PHPBB

Postby zanix » Sun Sep 17, 2006 3:11 am

Actually, this is not a bad idea
Maybe I can add code to detect no message and grab the one from the database
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: MOTD in PHPBB

Postby PazzeKahl » Sun Sep 17, 2006 9:01 pm

yeah, that's what i meant, but couldnt u just use the code of the roster page itself and just edit the path a little? I just cant find the code in the roster page... :scratch:
another thing what you could do is, is to make it grap the lines out of another table which is editable in the admin section of phpbb, to make a custom generated one! but i dont know how im supposed to intrigrate the motd, so it looks the message up on the database!

mfg Pazze
PazzeKahl
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Sat Sep 16, 2006 10:41 pm

MOTD in PHPBB

Postby Teksonic » Tue Sep 26, 2006 9:22 pm

Any update to this, i've been trying to get my phpBB to see the motd image all day.

I get the back ground and the no message indicator. I can edit it manual like the Pazze said. but I can't get it to parse the roster DB to get the current message.

Anyone know how to add string to the main phpbb forums to see the roster DB. note: my phpbb and my roster are in 2 differnet SQL db's.
Teksonic
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Fri Jul 14, 2006 7:23 pm

MOTD in PHPBB

Postby zanix » Tue Sep 26, 2006 10:00 pm

Yeah, this has been changed for Roster 1.7.1 which is at beta 2
So it should be out soon (~1 week)
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

MOTD in PHPBB

Postby PazzeKahl » Fri Sep 29, 2006 3:07 am

could u post a short description of how to do it as soon as you've time / the roster is out @ zanix?! thx already!!
PazzeKahl
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Sat Sep 16, 2006 10:41 pm

MOTD in PHPBB

Postby zanix » Fri Sep 29, 2006 3:11 am

Here's the motd.php file from roster 1.7.1

Code: Select all
<?php
/******************************
 * WoWRoster.net  Roster
 * Copyright 2002-2006
 * Licensed under the Creative Commons
 * "Attribution-NonCommercial-ShareAlike 2.5" license
 *
 * Short summary
 *  http:// creativecommons.org/licenses/by-nc-sa/2.5/
 *
 * Full license information
 *  http:// creativecommons.org/licenses/by-nc-sa/2.5/legalcode
 * -----------------------------
 *
 * $Id: motd.php 204 2006-09-17 09:31:44Z zanix $
 *
 ******************************/

//==========[ SETTINGS ]========================================================

$roster_root_path dirname(__FILE__) . DIRECTORY_SEPARATOR;

if( isset(
$_GET['motd']) )
{
    
$guildMOTD stripslashes(urldecode($_GET['motd']));
    
// Chomp $guildMOTD at 145 characters
    
$guildMOTD substr($guildMOTD,0,145);
}
else
{
    include( 
$roster_root_path 'settings.php' );
    
$guildMOTD $wowdb->get_guild_info($roster_conf['server_name'],$roster_conf['guild_name']);
    
$guildMOTD $guildMOTD['guild_motd'];
}



// Path to font folder
$image_path $roster_root_path 'img' DIRECTORY_SEPARATOR;
$font_path $roster_root_path 'fonts' DIRECTORY_SEPARATOR;


motd_img($guildMOTD,$image_path,$font_path);


//==========[ IMAGE GENERATOR ]=================================================

function motd_img$guildMOTD,$image_path,$font_path )
{
    
// Set ttf font
    
$visitor $font_path 'VERANDA.TTF';

    
// Get sizes of text
    
$dimensions imagettfbbox110$visitor$guildMOTD );
    
$text_length $dimensions[2] - $dimensions[6];

    
// Get how many times to print center
    
$image_size ceil($text_length/198);
    
$final_size 54 + ($image_size*198);
    
$text_loc = ($final_size/2) - ($dimensions[2]/2);

    
// Create new image
    
$img imagecreate($final_size,38);

    
// Get and combine base images, set colors
    
$img_file imagecreatefrompng($image_path 'gmotd.png');

    
// Copy image file into new image
    // Copy Left part
    
imagecopy $img$img_file00003838 );

    
// Copy center part however times needed
    
for ($i=0;$i<$image_size;$i++)
    {
        
imagecopy $img$img_file, ($i*198)+38039019838 );
    }
    
// Copy Right part
    
imagecopy $img$img_file, ($image_size*198)+38023701738 );

    
$textcolor imagecolorallocate($img255255255);

    
imagettftext($img110$text_loc23$textcolor$visitor$guildMOTD);

    
header('Content-type: image/png');
    
imagepng($img);
    
imagedestroy($img);
}
?>
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: MOTD in PHPBB

Postby jayrox » Fri Sep 29, 2006 5:09 am

on my guild's website i have included the gmotd on the homepage:

http://www.respecguild.com/

not an image though, just the text
jayrox
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Sat Jul 15, 2006 3:45 am

MOTD in PHPBB

Postby Fink » Sun Oct 01, 2006 5:02 pm

How did you just get the text without the image?
Fink
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Tue Jul 04, 2006 3:42 pm

MOTD in PHPBB

Postby dico » Mon Nov 06, 2006 12:58 pm

try this
Code: Select all
<img src="http://domain.com/roster/motd.php?motd_img>
dico
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Thu Oct 12, 2006 10:55 am

Re: MOTD in PHPBB

Postby shan_aya » Mon Nov 06, 2006 3:36 pm

hi,
it works ,thx !!

how i can "break" line in 2 if motd is too long ?
cauz it change my forum appeareance ^^
shan_aya
WR.net Journeyman
WR.net Journeyman
 
Posts: 132
Joined: Fri Aug 11, 2006 12:58 pm

MOTD in PHPBB

Postby Fink » Mon Nov 06, 2006 7:52 pm

Nope sadly that didnt work.

Look here
Fink
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Tue Jul 04, 2006 3:42 pm

MOTD in PHPBB

Postby shan_aya » Mon Nov 13, 2006 2:43 am

i use in my portail :
<img src="http://loupsjustice.guild-heberg.fr/roster/motd.php?motd_img" align=center>

but align=center doesn't works... right or left is ok

can you help me ?
shan_aya
WR.net Journeyman
WR.net Journeyman
 
Posts: 132
Joined: Fri Aug 11, 2006 12:58 pm


Return to phpBB

Who is online

Users browsing this forum: No registered users and 0 guests

cron