Created By
DMG Development
As Seen On

Main Page  |  Forums  |  Register  |  Active Topics  |  Members  |  Search

 
Username:
Password:
DMG Forums >> DMG Forums Discussion >> Tutorials & HOWTO Articles >> Examining the DMG Admin Codes
Examining the DMG Admin Codes
Author Topic
grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 7/10/2006 2:44:16 PM

DMG Admin Codes are available to portal administrators to help design pages that are dynamic and that are easily maintained from the admin tools rather than having to edit aspx pages or .NET code directly. This tutorial goes in depth with all of the admin codes that are available, how to use them, and what their outputs will be.
grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 7/10/2006 2:44:29 PM

DMG Forums is a unique application in that your entire portal layout can be designed from the admin tools rather than having to edit the .aspx pages or HTML code directly. This keeps your designs flexible and allows you to create layout templates which can be used to switch from one design to another with the click of a button. To help make your designs more dynamic, DMG Admin Codes have been provided to give advanced functionality to the portal pages you create.



Using DMG Admin Codes

The full suite of admin codes can be found here. These codes are different than the normal "DMG Codes" that are available to your normal forum members. The admin codes allow special objects to be posted to content pages or to the portal's custom HTML sections.

The two places in the application where DMG Admin Codes are allowed can be found in the Administration panel. The "Custom HTML Configuration" link allows you to specify HTML code that appears above and below your forum content. DMG Admin Codes can make these sections more dynamic and scalable. The admin codes are also eligible when clicking the "Create New Page" or "Edit Pages" buttons. Any portal pages can include DMG Admin Codes.

Now on to the admin codes and how they can be used.



[menu]
    The [menu] command displays the main menu for the site. This includes the Forums button as well as the Active Topics, Members, Register, User CP, Private Messages, Search, and Administration buttons. Any buttons in this menu that can not be viewed by non-members will automatically be hidden if the viewer is not logged in.

    The [menu] command also can take a parameter to determine if the menu should be displayed horizontally or vertically. To display a horizontal menu, use the [menu=H] command. To display it vertically, use [menu=V]. By default, the [menu] with no paramter will display horizontally.

    There is no font or size configuration in the menu. You can wrap <font> or <style> tags around the [menu] tag to format the text that is outputted.


[PageMenu]
    The [PageMenu] command is very similar to the [menu] command, however, it is for displaying only portal pages. Any portal pages that you create, including the default "Main Page," can be displayed using this command. The command only displays those pages that have been assigned the "Main Menu" as their parent. The order of the pages in this menu will match their "Sort By" field that can be entered in the "Create New Page" section of the admin tool.

    The [PageMenu] command can also take parameters to display horizontally or vertically. [PageMenu=H] will display a horizontal page menu, while [PageMenu=V] displays vertically. The code [PageMenu] with no parameter will display a horizontal menu.


[LatestTopics]
    The [LatestTopics] box can be used to display the threads with the most recent activity in a nicely formatted table. As an example, the box on the front page of this site that is titled "Latest Topics" was displayed using the [LatestTopics] code.

    To determine how many topics should be listed in this box, you must edit an option in the "Main Configuration" button of the administration toolkit. After clicking the "Main Configuration" button, you will see a drop-down box titled "Topics In Latest Topics Box." Enter a number in this box to specify the number of threads shown when the [LatestTopics] command is executed.


[LatestTopicsNoBox]
    The [LatestTopics] box comes preformatted inside a content box as it is displayed on the front page of this site. If you have a highly customized portal design and would only like to display the latest topics text with no formatting, use [LatestTopicsNoBox]. You can place any HTML, tables, or styles around the [LatestTopicsNoBox] command and it will fit into the layout of your page.


[LatestBlogs]
    The [LatestBlogs] code acts very similar to the [LatestTopics] command, except for blog entries. The most recently posted blogs will be displayed in a nicely formatted box. The number of blogs listed using this code is determined by editing the "Topics In Latest Blogs Box" option inside the Main Configuration section of the admin toolkit.


[LatestBlogsNoBox]
    Displays the most recently posted blog entries with no formatting. You can place your own HTML, tables, or styles around the [LatestBlogsNoBox] command to allow the content to fit into your layout.


[NewsTopics]
    When administrators make a post on the forums, they will see a checkbox by the submit button that asks if they would like to "Show Topic in the Latest News Box." If they check this box, it will be submitted to the forums, but marked as a news article, or featured article. When the [NewsTopics] code is used on any page, a formatted table will be displayed showing a certain amount of featured topics with the latest post appearing first. A prime example of this code in action would be the Featured Topics box on the home page of this site. All of the tutorials in this box were marked as "News Topics" and were eligible to appear on the homepage as a featured topic in the location where the [NewsTopics] code was placed.

    To determine how many featured topics will appear in the News Topics box, you must again go to the Main Configuration section of the Administration toolkit. In this section there is an option to specify the number of days that a news article can remain on the main page or any other custom page. If "0" is entered in this box, news articles will remain displayed with the [NewsTopics] command forever. If a number is entered, the topics will be displayed in this box only for the specified number of days. If no featured topics exist within the days specified, the box will not display at all.




[ContentBox=BOX_TITLE]BOX_TEXT[/ContentBox]
    The [ContentBox] command is used to quickly display a formatted table with text and a title on any page. The table is formatted to match the color scheme of the current layout template. The BOX_TITLE paramter must be specified to give the content box a title, and the text between the open tag and ending tag is used to specify what will be displayed inside the box. An example of the [ContentBox] command in action is the main text displayed at the top of the homepage on this site.


[RegisterLink]
    The [RegisterLink] command will display a "Register" link for a user that is not logged in and will display an "Edit Profile" link for a user that is logged in.


[AdminLink]
    Displays an "Administration" button for a user who is logged in as an admin. Displays nothing for normal users or users who are not logged in.


[PMLink]
    Displays a "Private Messages" link for logged in users. Displays nothing for users who are not logged in.


[Page=PAGE_ID]LINK_TITLE[/Page]
    The [Page] command is a quick way to post a link to a specific page. If you have created a page with the ID of 2, then [Page=2]LINK_TITLE[/Page] will display a link that goes to page #2 and has the text that you specify. An image can also be placed into the LINK_TITLE section to create a link to page 2 that is clicked through an image.

    The ID number can be found by browsing to the page and viewing the "ID=" text in the URL.


[Forums]LINK_TITLE[/Forums]
    Creates a link to the main forums page with any text that you specify.


[Forum=FORUM_ID]LINK_TITLE[/Forum]
    Creates a link to a specific forum with the given ID number. The ID number can be found by browsing to the forum and viewing the "ID=" text in the URL.


[CreateTopicLink]LINK_TITLE[/CreateTopicLink]
    Creates a link to the page that allows a member to post a topic. The LINK_TITLE text can be modified to include plain text or an image.




The following codes are used merely to display information from fields in your layout template. In the administration toolkit you will find fields with the same names as these codes. The codes will dynamically display that data that is located in these fields.

    [pagetitle]

    [forumlogo]

    [homeurl]

    [fontface]

    [fontcolor]

    [headercolor]

    [headerfontcolor]

    [bordercolor]

    [Var1]

    [Var2]

    [Var3]

    [Text1]

    [Text2]


The Var and Text commands are used in conjunction with the values that are entered in the "Custom Variables Configuration" section of the Admin toolkit. The pagetitle, forumlogo, and homeurl codes will display the web site's title, logo, and URL if they have been specified. The remaining commands are available for dynamically formatting your HTML to match the colors and fonts specified in the layout template.
grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 7/10/2006 2:47:27 PM

The HTML for the main page of this site is posted below to give an example of how DMG Admin Codes and HTML can be used in conjunction to create a portal page in DMG Forums. The advertisements have been removed to maintain clarity.




<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">

[ContentBox=DMG Forums 2.2 Now Released!]
<center><img src="images/22banner.gif" border="2" bordercolor="black"></center>
<br />
DMG Forums 2.2 is finally here! Many new features are packed into this major release that build upon the 2.x engine. The major topics covered were enhancing the member experience to allow for more profile options and to give them a new control panel to manage all user functions. Included with the new member features is a new blogging system, which allows users to post new blogs which are attached to their profile page.
<br /><br />
Another topic covered in this release was the addition of e-mail functionality. Administrators can now turn on options for users to send e-mails to each other or to receive e-mails upon updates to subscribed threads, which are also new in 2.2. In addition, admins can now require users to answer a verification e-mail before their registration is complete.
<br /><br />
<center><font size="3"><b><a href="topics.aspx?ID=59">Click Here To Download DMG Forums 2.2</a></b></font id="3"></center>
[/ContentBox]

<br />

[NewsTopics]

</td>
<td width="15">&nbsp;</td>
<td width="200" valign="top">

[LatestTopics]

</td>
</tr>
</table>


  Copyright DMG Development DMG Forums 3.2