Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN All Other Issues
Author Message
horrorcode
Involved
Involved



Joined: Jan 17, 2009
Posts: 272
Location: Missouri

PostPosted: Wed Mar 25, 2009 10:52 pm Reply with quote

Tried searching and didnt find much on the first, might be more of a theme related issue.

Just curious if theres any way to customize how "messages" are displayed on the homepage, more or less where theyre displayed, basically moving them to below the center blocks instead of above.

I did notice the message_box function in mainfile but cant figure out what says where theyre supposed to be displayed at the top, maybe a way to define this on a theme by theme basis?



Second issue isnt about where but to who the home module is displayed, I also noticed in index.php:

Quote:
montego - added so that main module may also have its view permissions configured


Not sure if that means what I think it means, but if it does it isnt working(for me), basically when I set a module to be the "home module" it removes all permisions in the modules admin and makes it visible to all. Wondering if theres any way to disable the home module all together?
 
View user's profile Send private message
dad7732
RavenNuke(tm) Development Team



Joined: Mar 18, 2007
Posts: 1242

PostPosted: Thu Mar 26, 2009 9:30 am Reply with quote

De-Activate your "messages" which will then bring the "center UP" block to the upper margin where messages used to be. Then add a new block, create the "look", etc. activate it, configure it to be the "center up". Works here in a test domain.
 
View user's profile Send private message
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Thu Mar 26, 2009 11:23 am Reply with quote

What I tend to do is make a blank module and place that in the home. Not sure about the message I am sure Montego can explain a bit more. Wink
 
View user's profile Send private message
horrorcode







PostPosted: Thu Mar 26, 2009 1:58 pm Reply with quote

dad7732, Thanks, actually makes more sense not to use messages when you can do the same with blocks.

And a blank module might work okay, this should be an option though imo.
 
horrorcode







PostPosted: Thu Mar 26, 2009 2:20 pm Reply with quote

Actually I found the calls to center blocks and messages, it's in header.php, dont know why I didnt think of that. Thanks again.
 
dad7732







PostPosted: Thu Mar 26, 2009 6:04 pm Reply with quote

I always use "messages" simply because you can edit easier rather than having to bring up the block and then edit,etc. Also, using the block method you have to edit out the block header depending on the theme. Like they say here, "whatever ruffler yer oyster". Smile
 
horrorcode







PostPosted: Thu Mar 26, 2009 7:37 pm Reply with quote

What Im thinking about doing is removing messages from header.php and writing a module, which would be the home module(two birds one stone), any suggestions on that?
 
horrorcode







PostPosted: Thu Mar 26, 2009 8:46 pm Reply with quote

Okay so I went ahead and removed the call in header.php and created a module, and everything looks okay now I'd just like some feedback on it:

Code:
$module_name = basename(dirname(__FILE__));

$page_title = 'Home';
include("header.php");
if (defined('HOME_FILE')) {
   message_box();
} else {
      header("Location: /"); /* Redirect browser */
}
include("footer.php");


So basically what it does is display messages on the home page, and if you try to go to the module directly you get redirected to the home page, pretty simple.

Anything wrong?

Thinking about redirecting to your account or displaying a login form, just need some feedback. Thanks again.
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Mar 28, 2009 7:52 am Reply with quote

Not sure what feedback you are looking for as it really is up to you as far as what you want for your users. However, I am now on a quest to break (or keep from starting) bad habits in PHP coding that are seen all over the *nuke code. Well, I guess using the word "bad" is a bit strong, but here is how I would have written that code:

Code:


$module_name = basename(dirname(__FILE__));
$page_title = 'Home';
include 'header.php';
if (defined('HOME_FILE')) {
   message_box();
} else {
   header('Location: /'); /* Redirect browser */
}
include 'footer.php';


It is functionally equivalent, so no worries. But, it uses the proper 'include' syntax and you don't want to use quotes for strings unless you really need to embed a variable within to get evaluated. Single quotes for strings are much, much faster.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
horrorcode







PostPosted: Sat Mar 28, 2009 3:46 pm Reply with quote

Thank you. I actually pulled that from an existing module(p messages maybe) , but this is really the first attempt Ive made at a "new" module. Speed is something I worry about, and when it comes to user friendlyness thats one of the most important issues imo.

As for feedback I mostly want to be sure this wont cause any errors with validation, markup etc, I think the redirect gives a 302 to the browser so could that be an issue?

Also, would it be smarter to use $module_name in place of Home in the title since it already does the extra step?

This may be a long shot, but would it be possible to "replicate" the appearance of the home page, like the "index" module does? What would be a good starting point?
 
rickleigh
Worker
Worker



Joined: Jan 06, 2009
Posts: 183

PostPosted: Sat Mar 28, 2009 11:15 pm Reply with quote

Hey guys,

I seen this topic and it was close to my question I wanted to ask. When I say close I mean a question on messages Smile

I'm wanting to know if there is a code that I can put in my message box that will say one thing for guest and another for members.

example: For guest it might say please register........... and for member it might say Welcome Back Members Name............

I know there is something like that in the login area on most themes but, I what it to change the full text messages between the two in the message box.
Thanks for any help on this

_________________
Thanks,
Rick Leigh 
View user's profile Send private message
jakec







PostPosted: Sun Mar 29, 2009 6:15 am Reply with quote

rickleigh, I would use two blocks for that and set their permissions accordingly.
 
jakec







PostPosted: Sun Mar 29, 2009 6:17 am Reply with quote

Actually the messages module has the ability to set the visibility depending on the user. Like Anon, Registered, All Users etc.
 
rickleigh







PostPosted: Sun Mar 29, 2009 8:57 am Reply with quote

jakec,

Thanks jakec,

I forgot all about that!
 
montego







PostPosted: Sun Mar 29, 2009 9:08 am Reply with quote

horrorcode wrote:
As for feedback I mostly want to be sure this wont cause any errors with validation, markup etc,


You need to just test it out and see. Wink

Quote:
I think the redirect gives a 302 to the browser so could that be an issue?


Question for you there: if you are just going to redirect people to the home page anyways, why would you ever make a link to the module visible? If its not visible, then no worries with the search engines and the 302.

Quote:
Also, would it be smarter to use $module_name in place of Home in the title since it already does the extra step?


You might try commenting out the $page_title line and just see if you like the default page title? (Can't recall if it defaults to one.)

Quote:
This may be a long shot, but would it be possible to "replicate" the appearance of the home page, like the "index" module does? What would be a good starting point?


Not sure what you are really after here... sorry.
 
draxx
Involved
Involved



Joined: Nov 19, 2003
Posts: 282

PostPosted: Sun Mar 29, 2009 12:54 pm Reply with quote

Post deleted - new topic started instead.
 
View user's profile Send private message
horrorcode







PostPosted: Mon Mar 30, 2009 11:38 am Reply with quote

Thanks again Smile

Ive been testing and so far no problems, that I didnt have otherwise.

Yeah no point in that second question, my head gets away from me sometimes...

Yep, didnt need that title line in there, works great.

Lastly, I was wondering if it was possible to duplicate the exact appearance of the home page, eg blocks layout module etc, but since Ive done so many modifications it would be alot easier to just style the module accordingly...

But then again, this also relates to that issue regarding why I would give a link to the module out to begin with, then I thought... Maybe I should work on creating a module that would allow users to choose exactly whats shown on that 1 page that they shouldnt have a link to in the first place...LOL, this is when I blanked out... Too much to think about,

Thanks a bunch.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN All Other Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©