Firefox PHP

Module: Static Pages

Posted by Ravenswood 
All files from this thread

File Name File Size   Posted by Date  
static_pages.zip 8 KB open | download Ravenswood 07/13/2009 Read message
Module: Static Pages
July 13, 2009 06:15PM
This module allows admins to create stand-alone ("static") pages using the formatting of the currently active template. Essentially, this module gives Phorum CMS capabilities, as the there is no limit on the number of pages you can generate and the module allows the admin to create, edit, and delete pages. Page contents can contain HTML, PHP, and template syntax including hooks.

Generated pages can be tied-in to Phorum, such as for a privacy policy, but can also be used for other generic uses such as articles, charts, etc. Once a page is created, the module generates the full URL of the page so it can be easily linked to.

This module utilizes the addon.php hook.

Future upgrades will include automatic formatting buttons and/or a WYSIWYG editor.

For more information, and screen shots, click here.

-------------------------------------------------------------------
"When given a choice, always choose monkeys."



Edited 1 time(s). Last edit at 07/13/2009 06:22PM by Ravenswood.
Attachments:
open | download - static_pages.zip (8 KB)
Re: Module: Static Pages
July 17, 2009 05:56PM
This is perfect for what I need. I'm not very savvy with coding and this will help me a lot.

This might be a real simple question, but how would I add the link to a new page to the top of my forum? Say I make a page that has a list of my forum rules. How would I put that up at the top the forum, next to the control center?
Re: Module: Static Pages
July 18, 2009 06:53AM
The easiest way, in my opinion, would be:

1. Install the Edit Theme Templates module, which is very similar in operation to the Static Pages module.

2. Using that module, select your theme, and edit "header.tpl"

3. Look for this section:

    <div id="user-info" class="{IF LOGGEDIN}logged-in{ELSE}logged-out{/IF}">

      {! Code for logged in users }
      {IF LOGGEDIN}
        <span class="welcome">{LANG->Welcome}, {USER->username}</span>
        <a class="icon icon-key-delete" href="{URL->LOGINOUT}">{LANG->LogOut}</a>
        <a class="icon icon-user-edit" href="{URL->REGISTERPROFILE}">{LANG->MyProfile}</a>
        {IF ENABLE_PM}
          <a class="icon icon-user-comment" href="{URL->PM}">
            {IF USER->new_private_messages}
              <strong>{LANG->NewPrivateMessages}</strong>
            {ELSE}
              {LANG->PrivateMessages}
            {/IF}
          </a>
        {/IF}

      {! Code for anonymous users }
      {ELSE}
        <span class="welcome">{LANG->Welcome}!</span>
        <a class="icon icon-key-go" href="{URL->LOGINOUT}">{LANG->LogIn}</a>
        <a class="icon icon-user-add" href="{URL->REGISTERPROFILE}">{LANG->Register}</a>
      {/IF}

    </div> <!-- end of div id=user-info -->

This is all of the links that appear at the top of the page. You said you wanted to add your link next to the control center, so I highlighted that in red in the listing. You would add something like this after it:

<a href="{URL->static_pages->forum_rules}">Forum rules</a>

(This is assuming you've named your page "forum_rules".)

That should do it. Let me know how it works for you. Thanks.

-------------------------------------------------------------------
"When given a choice, always choose monkeys."
Anonymous User
Re: Module: Static Pages
July 18, 2009 12:14PM
I wonder if it is possible to add a "Jump Menu" to static pages, via the "Jump Menu" and "Jump Menu Addlinks" modules.

edit:
I mean in fact, to multiply the jump menu feature to several buttons of a top bar menu.



Edited 1 time(s). Last edit at 07/18/2009 12:27PM by ab1.
Re: Module: Static Pages
July 18, 2009 01:07PM
No, the jump menu is fully targeted at showing a folder/forum navigation and it can only be linked to one element at a time. It possibly can be hacked to do something different, but it's not in there by design.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Static Pages
July 20, 2009 08:16PM
Quote
Ravenswood
That should do it. Let me know how it works for you. Thanks.

I'll try that. Thanks!
Re: Module: Static Pages
August 29, 2009 02:52AM
Strange, my message got caught up in Phorum's spam filters, so I guess I'll have to reword this and hope it goes through.

While using this module, deleting pages do cause their file names to disappear from the dropdown box, but also gives you an error that says the file was not deleted.

If you do incorporate the title name into this mod, is it possible to have it appear in the bookmark, like Home > Page Name? At the moment it just says Home > (instead of just "Home" like on the index page of the board).

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe




Edited 1 time(s). Last edit at 08/29/2009 03:42AM by Ryan.
Re: Module: Static Pages
August 29, 2009 02:47PM
An option for a page title, and adding it to the breadcrumb, would be superb! (as Ryan already pointed out).

- Bob
Re: Module: Static Pages
August 30, 2009 11:52AM
Quote
Ryan
Strange, my message got caught up in Phorum's spam filters, so I guess I'll have to reword this and hope it goes through.

While using this module, deleting pages do cause their file names to disappear from the dropdown box, but also gives you an error that says the file was not deleted.

Really? OK, I'll look into that.

Quote
Ryan
If you do incorporate the title name into this mod, is it possible to have it appear in the bookmark, like Home > Page Name? At the moment it just says Home > (instead of just "Home" like on the index page of the board).
Quote
Robert Angle
An option for a page title, and adding it to the breadcrumb, would be superb! (as Ryan already pointed out).

- Bob

That's actually something I was thinking about, but in order to get the module finished I decided to leave it out, with the plan of adding it in version two.

As I mentioned in another thread, I've been busy on some other projects. I've been trying to do a few pay jobs, since I've been out of work for over a year. As soon as I get some free time, I plan on getting back on some Phorum stuff.

-------------------------------------------------------------------
"When given a choice, always choose monkeys."
Re: Module: Static Pages
September 07, 2009 10:20PM
The Phorum Event Logger has been reporting an undefined variable and undefined index. It's probably not important, but figured I ought to let you know.

Quote

Undefined variable: zerdly_one
PHP notice generated at /mods/static_pages/settings.php:191

Quote

Undefined index: zerdly_one
PHP notice generated at /mods/static_pages/settings.php:148

The back trace for both of these reads:

Quote

Function include_once called at
{path to Phorum}/include/admin/modsettings.php:29
----
Function include_once called at
{path to Phorum}/admin.php:108

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Sorry, only registered users may post in this forum.

Click here to login