Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 link directory...can someone make this?
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #5
RE: link directory...can someone make this?
Requirement: XThreads
Last Edit: 7 October 2012

Other Version (Using One Forum Only): Links Directory

Create one forum type = c (Category)
  • Title: Link Directory
  • Template Prefix: xtld_
  • Hide Forum: Yes

Then create some forum type = f (Forum) under the category above. We will use it as Link Categories.
Each Forum settings:
  • Title: ..... We will use this forum title as Link Categories title. e.g: MyBB Forum
  • Description: We will use this forum description as Link Categories Description. e.g: All links related to MyBB Forum.
  • Template Prefix: xtld_
  • Settings Overrides:
    Setting: Showthread Options -> Post Layout
    Value: horizontal

    Code:
    postlayout=horizontal

  • Allow Blank Post Message: Yes
  • Un-check the reply ability for all user group.
  • Set which user group can create a thread per forum basis. It means that we can set which user group can submit a link in which link category. If only admin can submit link in all categories, un-check the ability to create a thread for all user group except for Administrators user group.
  • Set which user group can view our Link Directory.
    Basically, all user group permissions use MyBB built in permissions. Per forum (in this case, per link category) basis.

Basically, we can use this forum structure (just for example, modify it as our needs):
Link Directory => Category forum type - as our Link Directory "index".
-- Search Engine => Forum type - as link category
-- MyBB Forum => Forum type - as link category
-- Entertainment => Forum type - as link category
-- News And Education => Forum type - as link category

Custom Thread Fields Setting:
  1. Textbox for Website URL:
    Create a Custom Thread Fields with this settings:
    • Title: Website URL
    • Key: xtldwww
    • Applicable Forums: 'select all forum under category Link Directory'
    • Input Field Type: Textbox
    • Editable by / Required Field?: Everyone (required)
    • Text Mask Filter: URL (HTTP/S)
  2. Textbox for Site Description:
    Create a Custom Thread Fields with this settings:
    • Title: Site Description
    • Key: xtlddesc
    • Applicable Forums: 'select all forum above'
    • Input Field Type: Textbox
    • Editable by / Required Field?: Everyone (required)
    • Display Order: 2
  3. Textbox for Redirect Delay:
    I think we need to bump the clicker to show thread page first, so we can use {$thread['views']} variable, then, redirect the clicker to the website url.
    Create a Custom Thread Fields with this settings:
    • Title: Redirect Delay
    • Key: xtldrd
    • Applicable Forums: 'select all forum above'
    • Input Field Type: Textbox
    • Editable by / Required Field?: Not editable
    • Display Order: 3
    • Blank Replacement Value and Display Format:

      Code:
      <if $mybb->user['usergroup'] == 4 then>21<else>2</if>

      This is our redirection delay time for Administrator and regular user (in seconds). In this example, we set the redirect time 21 seconds for Admin,  so, we have enough time to click the edit button if we want to edit it. The redirect time for regular user is 2 seconds. After 2 seconds, they will be redirected to the Website URL. Modify it as our needs.

    • Hide Input Field: Yes
  4. Textbox for Back:
    We will create a back url to the forum id. This link can be viewed by Administrator only. I think we need this link because we will use the showthread template as redirection page. So, after we submit a link, we have a link to get us back to the thread list. I think it is better than hitting the browser Back button.
    And, we will use this fields to add edit post link for each thread in our threadlist (viewable by Admin only).
    Create a Custom Thread Fields with this settings:
    • Title: Back
    • Key: xtldback
    • Applicable Forums: 'select all forum above'
    • Input Field Type: Textbox
    • Editable by / Required Field?: Not editable
    • Display Order: 4
    • Blank Replacement Value and Display Format:

      HTML Code
      1
      2
      3
      4
      5
      6
      <if THIS_SCRIPT == 'forumdisplay.php' && $mybb->user['usergroup'] == 4 then>
      	<span> - <strong><a href="{$mybb->settings['bburl']}/editpost.php?pid={$thread['firstpost']}">Edit</a></strong></span>
      </if>
      <if THIS_SCRIPT == 'showthread.php' && $mybb->user['usergroup'] == 4 then>
      	<div style="text-align: center;"><strong><a href="{$forumurl}">Back</a></strong></div>
      </if>

    • Hide Input Field: Yes


New templates in Global Template.
Admin CP -> Templates & Style -> Templates -> Global Templates:
  1. Template Name: xtld_editpost

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    <html>
    <head>
    <title>{$mybb->settings['bbname']} - {$lang->edit_post}</title>
    {$headerinclude}
    <script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
    </head>
    <body>
    {$header}
    {$preview}
    {$post_errors}
    {$attacherror}
    <form action="editpost.php" method="post" name="editpost">
    	<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
    	<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    		<tr>
    			<td class="thead" colspan="3"><strong>{$lang->delete_post}</strong></td>
    		</tr>
    		<tr>
    			<td class="trow1" style="white-space: nowrap"><input type="checkbox" class="checkbox" name="delete" value="1" tabindex="9" /> <strong>{$lang->delete_q}</strong></td>
    			<td class="trow1" width="100%">{$lang->delete_1}<br /><span class="smalltext">{$lang->delete_2}</span></td>
    			<td class="trow1"><input type="submit" class="button" name="submit" value="{$lang->delete_now}" tabindex="10" /></td>
    		</tr>
    	</table>
    	<input type="hidden" name="action" value="deletepost" />
    	<input type="hidden" name="pid" value="{$pid}" />
    </form>
    <br />
    <form action="editpost.php?pid={$pid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
    	<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
    	<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    		<tr>
    			<td class="thead" colspan="2"><strong>{$lang->edit_post}</strong></td>
    		</tr>
    		<tr>
    			<td class="trow2"><strong>{$lang->subject}</strong></td>
    			<td class="trow2"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
    		</tr>
    		{$extra_threadfields}{$posticons}
    		<tr style="display: none;">
    			<td class="trow2" valign="top">
    				<strong>{$lang->your_message}:</strong>
    			</td>
    			<td class="trow2">
    				<textarea name="message" id="message" rows="20" cols="70" tabindex="3">{$message}</textarea>
    			</td>
    		</tr>
    	</table>
    	<br />
    	<div align="center"><input type="submit" class="button" name="submit" value="Update Link" tabindex="3" /></div>
    	<input type="hidden" name="action" value="do_editpost" />
    	<input type="hidden" name="posthash" value="{$posthash}" />
    	<input type="hidden" name="attachmentaid" value="" />
    	<input type="hidden" name="attachmentact" value="" />
    </form>
    {$footer}
    </body>
    </html>

  2. Template Name: xtld_forumbit_depth2_forum

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    <tr>
    	<td class="{$bgcolor}">
    		<strong><a href="{$forum_url}">{$forum['name']}</a></strong>
    		({$threads}{$unapproved['unapproved_threads']} Links)
    		{$forum_viewers_text}
    		<div class="smalltext">{$forum['description']}</div>
    	</td>
    </tr>

  3. Template Name: xtld_forumdisplay_inlinemoderation_col

    HTML Code
    <td class="thead" align="center" width="1"><input type="checkbox" name="allbox" onclick="inlineModeration.checkAll(this)" /></td>

  4. Template Name: xtld_forumdisplay_nothreads

    HTML Code
    <tr>
    	<td colspan="{$colspan}" class="trow1" align="center">
    		<strong><em>Sorry, but curently no links in {$foruminfo['name']} category</em></strong>
    	</td>
    </tr>

  5. Template Name: xtld_forumdisplay_subforums

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="thead"><strong>Links Categories</strong></td>
    </tr>
    {$forums}
    </table>
    <br />
    <div style="text-align: center;" class="smalltext">
    	Link Directory<br />
    	Powered By <a href="http://mybbhacks.zingaburga.com">XThreads</a> - <a href="http://mybbhacks.zingaburga.com">MyBB Hacks</a>
    </div>
    <br />

  6. Template Name: xtld_forumdisplay_thread

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    <tr>
    	<td align="center" class="{$bgcolor}" width="1">
    		<img src="{$theme['imgdir']}/{$folder}.gif" alt="{$folder_label}" title="{$folder_label}" />
    	</td>
    	<td class="{$bgcolor}">
    		<strong><a href="{$thread['threadlink']}" target="_blank" class="{$inline_edit_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a></strong>
    		({$thread['views']} {$lang->views}){$GLOBALS['threadfields']['xtldback']}
    		<div class="smalltext"><strong>Submitted By: {$thread['profilelink']}</strong> - <em>{$thread['threaddate']} at {$thread['threadtime']}</em></div>
    		<div class="smalltext">{$GLOBALS['threadfields']['xtlddesc']}</div>
    	</td>
    	{$modbit}
    </tr>

  7. Template Name: xtld_forumdisplay_threadlist

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" colspan="2">
    				<strong>Links - {$foruminfo['name']}</strong>
    		</td>
    		{$inlinemodcol}
    	</tr>
    	{$threads}{$nullthreads}
    </table>
    <div class="float_left">
    	{$multipage}
    </div>
    <div class="float_right">
    	{$newthread}
    </div>
    <br style="clear: both;" />
    <br />
    <div class="float_right" style="text-align: right;">
    	{$inlinemod}
    	{$searchforum}
    </div>
    <br style="clear: both" />
    <div style="text-align: center;" class="smalltext">
    	Link Directory<br />
    	Powered By <a href="http://mybbhacks.zingaburga.com">XThreads</a> - <a href="http://mybbhacks.zingaburga.com">MyBB Hacks</a>
    </div>
    {$inline_edit_js}

  8. Template Name: xtld_newthread

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    <html>
    <head>
    <title>{$lang->newthread_in}</title>
    {$headerinclude}
    <script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
    </head>
    <body>
    {$header}
    {$preview}
    {$thread_errors}
    {$attacherror}
    <form action="newthread.php?fid={$fid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
    	<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
    	<div style="width: 600px; margin: auto auto">
    		<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    			<tr>
    				<td class="thead" colspan="2"><strong>New Link</strong></td>
    			</tr>
    			<tr>
    				<td class="trow2" width="30%"><strong>Link Title</strong></td>
    				<td class="trow2">
    					<input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" />
    				</td>
    			</tr>
    			{$extra_threadfields}
    			{$modoptions}
    			{$captcha}
    		</table>
    	</div>
    	<br />
    	<div style="text-align:center">
    		<input type="submit" class="button" name="submit" value="Submit Link" tabindex="4" accesskey="s" />
    	</div>
    	<input type="hidden" name="action" value="do_newthread" />
    	<input type="hidden" name="posthash" value="{$posthash}" />
    	<input type="hidden" name="attachmentaid" value="" />
    	<input type="hidden" name="attachmentact" value="" />
    	<input type="hidden" name="quoted_ids" value="{$quoted_ids}" />
    	<input type="hidden" name="tid" value="{$tid}" />
    	{$editdraftpid}
    </form>
    {$forumrules}
    {$footer}
    </body>
    </html>

  9. Template Name: xtld_postbit

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    {$ignore_bit}
    <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}" width="100%">
    	<tbody>
    		<tr>
    			<td class="post_content {$unapproved_shade}">
    				<div style="margin: auto auto; width: 600px;" align="center">
    					<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    						<tr>
    							<td class="thead">
    								<strong>Redirect To {$post['subject']}</strong>
    							</td>
    						</tr>
    						<tr>
    							<td class="trow1">
    								<div class="post_body" id="pid_{$post['pid']}" style="text-align: center;">
    									<img src="images/spinner_big.gif" alt="" title="Redirecting to {$post['subject']} ....." />
    									<p>Redirecting to {$post['subject']} .....</p>
    								</div>
    								{$post['button_edit']}{$post['button_quickdelete']}
    							</td>
    						</tr>
    						<tr>
    							<td class="trow2" align="right">
    								<a href="{$GLOBALS['threadfields']['xtldwww']}"><span class="smalltext">{$lang->click_no_wait}</span></a>
    							</td>
    						</tr>
    					</table>
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>

  10. Template Name: xtld_showthread

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <html>
    <head>
    <title>{$thread['subject']}</title>
    {$headerinclude}
    <meta http-equiv="refresh" content="{$GLOBALS['threadfields']['xtldrd']};URL={$GLOBALS['threadfields']['xtldwww']}" />
    <script type="text/javascript">
    <!--
    	var quickdelete_confirm = "{$lang->quickdelete_confirm}";
    // -->
    </script>
    <script type="text/javascript" src="jscripts/thread.js?ver=1400"></script>
    </head>
    <body>
    {$GLOBALS['threadfields']['xtldback']}
    <div id="posts" style="margin-top: 200px;">
    	{$first_post}{$posts}
    </div>
    </body>
    </html>

  11. Template Name: xtld_forumdisplay_threads_sep

    HTML Code
    <tr>
    <td class="trow_sep" colspan="{$colspan}">Normal Links</td>
    </tr>

  12. Template Name: xtld_forumdisplay_sticky_sep

    HTML Code
    <tr>
    <td class="trow_sep" colspan="{$colspan}">Important Links</td>
    </tr>



We still have moderation tools for each "Link" (thread), like unapproved, delete and edit.

Change Log:
#1 - #2 - #3 - #4 - #5

Screenshoots:

New Links Form:
   

Links Directory Categories
   

Links In Categories - Admin View:
   

Links In Categories - User View:
   

Redirect Page for Admin
   

Redirect Page for "regular" clicker.
   

Live Demo:
http://www.14.mynie.co.cc/forumdisplay.php?fid=46
http://www.7173mustangs.com/forum-link-directory
http://leetlink.com/Forum-Directory

(This post was last modified: 10-08-2012 02:22 AM by RateU.)
07-29-2010 01:19 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: link directory...can someone make this? - RateU - 07-29-2010 01:19 PM

 Standard Tools
Forum Jump: