MOTD questions

Requests, feedback, and general discussion about WoWRoster
DO NOT post topics about WoWRoster AddOns here!

MOTD questions

Postby Rumik » Thu Jun 21, 2007 8:13 pm

Hi there,

I'm trying to get my guild's MOTD on the frontpage of my site and would like JUST the MOTD. Can someone please tell me how to create a new file that JUST displays the MOTD in text format?

Also, is there a way of making the MOTD image box shorter? The amount of space I have is only about 550 pixels and the text in the mage doesn't wrap.

Thanks :)
Rumik
WR.net Apprentice
WR.net Apprentice
 
Posts: 24
Joined: Fri Jun 15, 2007 2:18 pm

MOTD questions

Postby zanix » Thu Jun 21, 2007 10:23 pm

You can change the MOTD to text mode in Roster Config -> Display
Right now the image resizes to the length of text

As for a page that only gets the motd, I don't have any time at the moment to give you an example, I will later though
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 questions

Postby Rumik » Thu Jun 21, 2007 10:29 pm

Great thanks, I look forward to it :)
Rumik
WR.net Apprentice
WR.net Apprentice
 
Posts: 24
Joined: Fri Jun 15, 2007 2:18 pm

Re: MOTD questions

Postby tuigii » Thu Jun 21, 2007 10:42 pm

Rumik wrote:Also, is there a way of making the MOTD image box shorter? The amount of space I have is only about 550 pixels and the text in the mage doesn't wrap.


Open motd.php and change line 54
Code: Select all
$dimensions = imagettfbbox( 10, 0, $visitor, $guildMOTD );

and line 82
Code: Select all
imagettftext( $img, 10, 0, $text_loc, 23, $textcolor, $visitor, $guildMOTD );

The values "10" (I think 11 in your case) are the text size - just lower them both - and you're done.
Lines 29-31 tell's you how to obtain the MOTD text.

Look over here to check it out :
www.les-potes-ages.fr
What I do on my site (a phpBB2 one) :
I threw in this line :
<div style="text-align:center;margin:10px;"><img src="../roster/motd.php?motd_img" align=middle></div>
on the very last line in the overall_header.tpl file (a template file).

More info about how the retrieve the info can be found in memberslist.php (a roster file), lines 25-50.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Re: MOTD questions

Postby Rumik » Thu Jun 21, 2007 11:18 pm

Hi there, thanks for replying. That changes the size of the font just fine, but it doesn't reduce the size of the image - is this possible too?

I think I'll just stick to the text version, as it wraps.

So I'd still like to be able to have a file which just the text version of the MOTD in it. Like motd.php but the text version, not the image version.
Rumik
WR.net Apprentice
WR.net Apprentice
 
Posts: 24
Joined: Fri Jun 15, 2007 2:18 pm

MOTD questions

Postby zanix » Fri Jun 22, 2007 11:48 am

Just copy parts of motd.php that you need
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 questions

Postby mdeshane » Fri Jun 22, 2007 2:02 pm

I have worked a bit on a modified motd.php that checks the length of the MOTD and wraps the text if it's too long. I also resized the image a bit and renamed it gmotd_wrapped.png for when it's wrapped. It would be nice to see the devs clean it up a bit and maybe use it in 1.8.
Attachments
wrapped_motd.zip
Just unzip and copy to your wowroster folder.
(18.07 KiB) Downloaded 281 times
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 204
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US

Re: MOTD questions

Postby tuigii » Fri Jun 22, 2007 2:12 pm

Rumik wrote:...That changes the size of the font just fine, but it doesn't reduce the size of the image - is this possible too?

That exactly what's the first line should do !
The imagettfbbox function will fitt / reduce the "image size" (the red bar), that's why it's being used in the first place.

Just try to leave to "10" value to an 11 (thge first occurance) - you'll see what I mean.
The Red image bar will be ajusted for 11 point text size, and thus be mutch longer. The text, actually drawn in the second function, will be shorter.

Rumik wrote:...I think I'll just stick to the text version, as it wraps.
One of my old Roster dreams is that the MOTD text image will wrap (if longer then x characters). mdeshane , I'll toys with your upload, that's fore sure ^^
Last edited by tuigii on Fri Jun 22, 2007 2:14 pm, edited 1 time in total.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Re: MOTD questions

Postby Rumik » Fri Jun 22, 2007 2:39 pm

Thanks very much for this, this has definitely started me off on the right track!

Check out http://wivesoflazarou.lanwars.org/index ... &Itemid=14

If I could just get the total length of the image down to 550 pixels then it'll work and not need to be zoomed in on... can you help me configure your motd.php to do this?

Thanks :)


mdeshane wrote:I have worked a bit on a modified motd.php that checks the length of the MOTD and wraps the text if it's too long. I also resized the image a bit and renamed it gmotd_wrapped.png for when it's wrapped. It would be nice to see the devs clean it up a bit and maybe use it in 1.8.
Rumik
WR.net Apprentice
WR.net Apprentice
 
Posts: 24
Joined: Fri Jun 15, 2007 2:18 pm

MOTD questions

Postby PleegWat » Fri Jun 22, 2007 4:47 pm

Rumik: Please re-insert the credits from the roster footer in your integration.

The current MOTD image doesn't support vertical resizing, so breaking the line would require reducing the font enough so it will fit. That might be doable when breaking into two lines, but would definitely result in too small text or look cramped for three lines.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Re: MOTD questions

Postby Rumik » Fri Jun 22, 2007 4:51 pm

Okiedokie then, the image is a no-go.

Sorry about removing the copyright stuff, I'll sort that as soon as I get home from work.

Any chance I could get some help with having the text MOTD on its own page?
Rumik
WR.net Apprentice
WR.net Apprentice
 
Posts: 24
Joined: Fri Jun 15, 2007 2:18 pm

MOTD questions

Postby PleegWat » Fri Jun 22, 2007 4:53 pm

I'm not gonna write the code for you, but you'll have to query the roster DB

SELECT `guild_motd` FROM `roster_guild` WHERE `guild_id` = 1;

Or something along those lines.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

MOTD questions

Postby Rumik » Fri Jun 22, 2007 5:00 pm

Thanks for the tip, I appreciate it, but I don't know php and though I'm sure it's a very simple thing to do, i don't have the time to figure it out, which is why I'm posting here asking for help. If anyone would be kind enough to help me with this, I'd really appreciate it.
Rumik
WR.net Apprentice
WR.net Apprentice
 
Posts: 24
Joined: Fri Jun 15, 2007 2:18 pm

MOTD questions

Postby Rumik » Sat Jun 23, 2007 8:18 am

I sorted it out myself, thanks for all the input guys.
Rumik
WR.net Apprentice
WR.net Apprentice
 
Posts: 24
Joined: Fri Jun 15, 2007 2:18 pm

Re: MOTD questions

Postby tuigii » Sat Jun 23, 2007 8:40 am

PleegWat wrote:...but would definitely result in too small text or look cramped for three lines.
True.
But max text size will be clipped to 145 character in the motd.php code.
And
Blizzard doesn't allow us neither to use more then 145 chars (even less, I think) when I edit the MOTD IG.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Next

Return to General Support & Feedback

Who is online

Users browsing this forum: No registered users and 1 guest

cron