Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Restaurant Review
RateU Offline
Administrator
*******
Posts: 2,349
Joined: Mar 2010
Post: #1
Restaurant Review
Requirement: XThreads

This is a very simple example for creating a Restaurant Review section on our forum.
Because I don't have much idea for the design, so I use the Comp Specs, Usermaps and adopt the Author Rating layout for this Biggrin
Just modify it as our needs.

Create/edit a forum:
AdminCP -> Forums & Posts -> Forum Management:
  • Template Prefix: resrev_
  • Show first post on every showthread page: Yes
  • Enable XThreads' Inline Forum Search: Yes

Create a Custom Thread Fields:
AdminCP -> Configuration -> Custom Thread Fields
  1. Option Buttons for Food Rating
    • Title: Food
    • Key: resrev_food
    • Applicable Forums: select our Restaurant Review forum
    • Input Field Type: Option Buttons
    • Values List:

      Code:
      1{|}<img src="images/star.gif" alt="1 star" />
      2{|}<img src="images/star.gif" alt="2 stars" />
      3{|}<img src="images/star.gif" alt="3 stars" />
      4{|}<img src="images/star.gif" alt="4 stars" />
      5{|}<img src="images/star.gif" alt="5 stars" />

      Modify it as our needs

    • Editable by / Required Field?: Everyone (required)
    • Display Order: 1
    • Allow Filtering: Yes
    • Display Format:

      HTML Code
      <tr><td style="white-space:nowrap;width:1%">{$GLOBALS['threadfields_x']['resrev_food']['title']}</td><td><ul class="star_rating float_left"><li style="width:{VALUE}%" class="current_rating"></li></ul></td></tr>

      Modify it as our needs.

    • Underlying Data Type: Integer (unsigned)
    • Formatting Map List:
      • Value: 1
        Displayed Output: 20
      • Value: 2
        Displayed Output: 40
      • Value: 3
        Displayed Output: 60
      • Value: 4
        Displayed Output: 80
      • Value: 5
        Displayed Output: 100

      Code:
      1{|}20
      2{|}40
      3{|}60
      4{|}80
      5{|}100

    • Use Custom Input HTML: Yes
    • Input Field HTML:

      Code:
      <![ITEM[<label class="float_left" title="{VALUE} star<if {VALUE} > 1 then>s</if>"><input{NAME_PROP} type="radio" class="radio" value="{VALUE}"{CHECKED}{TABINDEX_PROP} /><div style="text-align:center">{LABEL}</div></label>]]>

  2. Option Buttons for Service Rating
    • Title: Service
    • Key: resrev_service
    • Applicable Forums: select our Restaurant Review forum
    • Input Field Type: Option Buttons
    • Values List:

      Code:
      1{|}<img src="images/star.gif" alt="1 star" />
      2{|}<img src="images/star.gif" alt="2 stars" />
      3{|}<img src="images/star.gif" alt="3 stars" />
      4{|}<img src="images/star.gif" alt="4 stars" />
      5{|}<img src="images/star.gif" alt="5 stars" />

      Modify it as our needs

    • Editable by / Required Field?: Everyone (required)
    • Display Order: 2
    • Allow Filtering: Yes
    • Display Format:

      HTML Code
      <tr><td style="white-space:nowrap;width:1%">{$GLOBALS['threadfields_x']['resrev_service']['title']}</td><td><ul class="star_rating float_left"><li style="width:{VALUE}%" class="current_rating"></li></ul></td></tr>

      Modify it as our needs.

    • Underlying Data Type: Integer (unsigned)
    • Formatting Map List:
      • Value: 1
        Displayed Output: 20
      • Value: 2
        Displayed Output: 40
      • Value: 3
        Displayed Output: 60
      • Value: 4
        Displayed Output: 80
      • Value: 5
        Displayed Output: 100

      Code:
      1{|}20
      2{|}40
      3{|}60
      4{|}80
      5{|}100

    • Use Custom Input HTML: Yes
    • Input Field HTML:

      Code:
      <![ITEM[<label class="float_left" title="{VALUE} star<if {VALUE} > 1 then>s</if>"><input{NAME_PROP} type="radio" class="radio" value="{VALUE}"{CHECKED}{TABINDEX_PROP} /><div style="text-align:center">{LABEL}</div></label>]]>

  3. Option Buttons for Atmosphere Rating
    • Title: Atmosphere
    • Key: resrev_atm
    • Applicable Forums: select our Restaurant Review forum
    • Input Field Type: Option Buttons
    • Values List:

      Code:
      1{|}<img src="images/star.gif" alt="1 star" />
      2{|}<img src="images/star.gif" alt="2 stars" />
      3{|}<img src="images/star.gif" alt="3 stars" />
      4{|}<img src="images/star.gif" alt="4 stars" />
      5{|}<img src="images/star.gif" alt="5 stars" />

      Modify it as our needs

    • Editable by / Required Field?: Everyone (required)
    • Display Order: 3
    • Allow Filtering: Yes
    • Display Format:

      HTML Code
      <tr><td style="white-space:nowrap;width:1%">{$GLOBALS['threadfields_x']['resrev_atm']['title']}</td><td><ul class="star_rating float_left"><li style="width:{VALUE}%" class="current_rating"></li></ul></td></tr>

      Modify it as our needs.

    • Underlying Data Type: Integer (unsigned)
    • Formatting Map List:
      • Value: 1
        Displayed Output: 20
      • Value: 2
        Displayed Output: 40
      • Value: 3
        Displayed Output: 60
      • Value: 4
        Displayed Output: 80
      • Value: 5
        Displayed Output: 100

      Code:
      1{|}20
      2{|}40
      3{|}60
      4{|}80
      5{|}100

    • Use Custom Input HTML: Yes
    • Input Field HTML:

      Code:
      <![ITEM[<label class="float_left" title="{VALUE} star<if {VALUE} > 1 then>s</if>"><input{NAME_PROP} type="radio" class="radio" value="{VALUE}"{CHECKED}{TABINDEX_PROP} /><div style="text-align:center">{LABEL}</div></label>]]>

  4. Option Buttons for Value Rating
    • Title: Value
    • Key: resrev_value
    • Applicable Forums: select our Restaurant Review forum
    • Input Field Type: Option Buttons
    • Values List:

      Code:
      1{|}<img src="images/star.gif" alt="1 star" />
      2{|}<img src="images/star.gif" alt="2 stars" />
      3{|}<img src="images/star.gif" alt="3 stars" />
      4{|}<img src="images/star.gif" alt="4 stars" />
      5{|}<img src="images/star.gif" alt="5 stars" />

      Modify it as our needs

    • Editable by / Required Field?: Everyone (required)
    • Display Order: 4
    • Allow Filtering: Yes
    • Display Format:

      HTML Code
      <tr><td style="white-space:nowrap;width:1%">{$GLOBALS['threadfields_x']['resrev_value']['title']}</td><td><ul class="star_rating float_left"><li style="width:{VALUE}%" class="current_rating"></li></ul></td></tr>

      Modify it as our needs.

    • Underlying Data Type: Integer (unsigned)
    • Formatting Map List:
      • Value: 1
        Displayed Output: 20
      • Value: 2
        Displayed Output: 40
      • Value: 3
        Displayed Output: 60
      • Value: 4
        Displayed Output: 80
      • Value: 5
        Displayed Output: 100

      Code:
      1{|}20
      2{|}40
      3{|}60
      4{|}80
      5{|}100

    • Use Custom Input HTML: Yes
    • Input Field HTML:

      Code:
      <![ITEM[<label class="float_left" title="{VALUE} star<if {VALUE} > 1 then>s</if>"><input{NAME_PROP} type="radio" class="radio" value="{VALUE}"{CHECKED}{TABINDEX_PROP} /><div style="text-align:center">{LABEL}</div></label>]]>

  5. Textbox for Location
    • Title: Location
    • Key: resrev_location
    • Applicable Forums: select our Restaurant Review forum
    • Input Field Type: Textbox
    • Editable by / Required Field?: Everyone (required)
    • Display Order: 5
    • Hide Input Field: Yes
    • Use Custom Input HTML: Yes
    • Input Field HTML:

      Code:
      <br /><div style="margin:auto auto"><input type="text" class="textbox" id="xthreads_{KEY}"{NAME_PROP}{MAXLEN_PROP}{WIDTH_PROP_SIZE}{TABINDEX_PROP} value="{VALUE}" /><input type="button" value="Get Geo Location" onclick="codeAddress()"></div>

  6. Textbox for Geo Location
    We'll try to map the restaurant location.
    • Title: Geo Location
    • Key: resrev_geo
    • Applicable Forums: select our Restaurant Review forum
    • Input Field Type: Textbox
    • Editable by / Required Field?: Everyone
      This is not a required field.
    • Display Order: 6
    • Display Format:

      Code:
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
      <script type="text/javascript">
      var geocoder, map;
      function initialize() {
      	geocoder = new google.maps.Geocoder();
      	var myLatlng = new google.maps.LatLng{VALUE};
      	var myOptions = {
      		zoom: 4,
      		center: myLatlng,
      		mapTypeId: google.maps.MapTypeId.ROADMAP
      	}
      	map = new google.maps.Map(document.getElementById('map_postbit'), myOptions);
      	var marker = new google.maps.Marker({
      		position: myLatlng, 
      		map: map
      	});
      }
      </script>
      <setvar resrev_map>'<div id="map_postbit" style="width:300px;height:150px;"></div>'</setvar>
      <setvar resrev_geo>{VALUE}</setvar>

    • Text Mask Filter: Custom (regex)

      Code:
      ^\(((-?)([0-9]*)(?:\.(\d*)), (-?)([0-9]*)(?:\.(\d*)))\)$

      Modify it as our needs.

  7. File for restaurant Photo
    • Title: Photo
    • Key: resrev_photo
    • Applicable Forums: select our Restaurant Review forum
    • Input Field Type: File
    • Valid File Extensions: jpg|jpeg|gif|png
    • Maximum File Size: 204800
      Modify it as our needs.
    • Editable by / Required Field?: Everyone (required)
    • Display Order: 7
    • Only Accept Image Files: Yes
    • Image Thumbnail Generation: 120x90|200x150
    • Display Format:

      Code:
      <if THIS_SCRIPT == 'forumdisplay.php' then><a href="{$threadurl}"><img src="{URL}/thumb120x90" alt="{FILENAME}" /></a><else><a href="{URL}" target="_blank"><img src="{URL}/thumb200x150" alt="{FILENAME}" /></a></if>



We need to create new templates in Global Template.
Admin CP -> Templates & Style -> Templates -> Global Templates:
  1. resrev_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
    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
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    <div class="float_left">
    	{$multipage}
    </div>
    <div class="float_right">
    	{$newthread}
    </div>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" colspan="{$colspan}">
    			<div style="float: right;">
    				<span class="smalltext"><strong><a href="misc.php?action=markread&amp;fid={$fid}{$post_code_string}">{$lang->markforum_read}</a> | <a href="usercp2.php?action={$add_remove_subscription}subscription&amp;type=forum&amp;fid={$fid}&amp;my_post_key={$mybb->post_code}">{$add_remove_subscription_text}</a>{$clearstoredpass}</strong></span>
    			</div>
    			<div>
    				<strong><a href="{$forumurl}">{$foruminfo['name']}</a></strong>
    			</div>
    		</td>
    	</tr>
    	<tr>
    		<td class="tcat" colspan="3" width="66%"><span class="smalltext"><strong><a href="{$sorturl}&amp;sortby=subject&amp;order=asc">{$lang->thread}</a> {$orderarrow['subject']} / <a href="{$sorturl}&amp;sortby=starter&amp;order=asc">{$lang->author}</a> {$orderarrow['starter']}</strong></span></td>
    		<td class="tcat" align="center" width="7%"><span class="smalltext"><strong><a href="{$sorturl}&amp;sortby=replies&amp;order=desc">{$lang->replies}</a> {$orderarrow['replies']}</strong></span></td>
    		<td class="tcat" align="center" width="7%"><span class="smalltext"><strong><a href="{$sorturl}&amp;sortby=views&amp;order=desc">{$lang->views}</a> {$orderarrow['views']}</strong></span></td>
    		{$ratingcol}
    		<td class="tcat" align="right" width="20%"><span class="smalltext"><strong><a href="{$sorturl}&amp;sortby=lastpost&amp;order=desc">{$lang->lastpost}</a> {$orderarrow['lastpost']}</strong></span></td>
    		{$inlinemodcol}
    	</tr>
    	{$selectall}
    	{$announcementlist}
    	{$threads}{$nullthreads}
    	<tr>
    		<td class="tfoot" align="right" colspan="{$colspan}">
    			<form action="forumdisplay.php" method="get">
    				<input type="hidden" name="selectall" value="{$allselected}" />
    				<input type="hidden" name="fid" value="{$fid}" />
    				<select name="sortby">
    					{$sort_by_prefix}<option value="subject" {$sortsel['subject']}>{$lang->sort_by_subject}</option>
    					<option value="lastpost" {$sortsel['lastpost']}>{$lang->sort_by_lastpost}</option>
    					<option value="starter" {$sortsel['starter']}>{$lang->sort_by_starter}</option>
    					<option value="started" {$sortsel['started']}>{$lang->sort_by_started}</option>
    					{$ratingsort}
    					<option value="replies" {$sortsel['replies']}>{$lang->sort_by_replies}</option>
    					<option value="views" {$sortsel['views']}>{$lang->sort_by_views}</option>
    					<option value="icon" {$sortsel['icon']}>{$lang->sort_by_icon}</option>
    					<option value="lastposter" {$sortsel['lastposter']}>{$lang->sort_by_lastposter}</option>
    					<option value="attachmentcount" {$sortsel['attachmentcount']}>{$lang->sort_by_attachmentcount}</option>
    					{$xthreads_extra_sorting}
    				</select>
    				<select name="order">
    					<option value="asc" {$ordersel['asc']}>{$lang->sort_order_asc}</option>
    					<option value="desc" {$ordersel['desc']}>{$lang->sort_order_desc}</option>
    				</select>
    				<select name="datecut">
    					<option value="1" {$datecutsel['1']}>{$lang->datelimit_1day}</option>
    					<option value="5" {$datecutsel['5']}>{$lang->datelimit_5days}</option>
    					<option value="10" {$datecutsel['10']}>{$lang->datelimit_10days}</option>
    					<option value="20" {$datecutsel['20']}>{$lang->datelimit_20days}</option>
    					<option value="50" {$datecutsel['50']}>{$lang->datelimit_50days}</option>
    					<option value="75" {$datecutsel['75']}>{$lang->datelimit_75days}</option>
    					<option value="100" {$datecutsel['100']}>{$lang->datelimit_100days}</option>
    					<option value="365" {$datecutsel['365']}>{$lang->datelimit_lastyear}</option>
    					<option value="9999" {$datecutsel['9999']}>{$lang->datelimit_beginning}</option>
    				</select>
    				{$gobutton}
    			</form>
    		</td>
    	</tr>
    </table>
    <div class="float_left">
    	{$multipage}
    </div>
    <div class="float_right" style="margin-top: 4px;">
    	{$newthread}
    </div>
    <br style="clear: both;" />
    <br />
    <div class="float_left">
    	<div class="float_left">
    		<dl class="thread_legend smalltext">
    			<dd><img src="{$theme['imgdir']}/newfolder.gif" alt="{$lang->new_thread}" title="{$lang->new_thread}" /> {$lang->new_thread}</dd>
    			<dd><img src="{$theme['imgdir']}/newhotfolder.gif" alt="{$lang->new_hot_thread}" title="{$lang->new_hot_thread}" /> {$lang->new_hot_thread}</dd>
    			<dd><img src="{$theme['imgdir']}/hotfolder.gif" alt="{$lang->hot_thread}" title="{$lang->hot_thread}" /> {$lang->hot_thread}</dd>
    		</dl>
    	</div>
    
    	<div class="float_left">
    		<dl class="thread_legend smalltext">
    			<dd><img src="{$theme['imgdir']}/folder.gif" alt="{$lang->no_new_thread}" title="{$lang->no_new_thread}" /> {$lang->no_new_thread}</dd>
    			<dd><img src="{$theme['imgdir']}/dot_folder.gif" alt="{$lang->posts_by_you}" title="{$lang->posts_by_you}" /> {$lang->posts_by_you}</dd>
    			<dd><img src="{$theme['imgdir']}/lockfolder.gif" alt="{$lang->locked_thread}" title="{$lang->locked_thread}" /> {$lang->locked_thread}</dd>
    		</dl>
    	</div>
    	<br style="clear: both" />
    </div>
    
    <div class="float_right" style="text-align: right;">
    	{$searchforum}
    	{$inlinemod}
    	{$forumjump}
    </div>
    <br style="clear: both" />
    <div style="text-align:center" class="smalltext">
    {$foruminfo['name']}<br />
    Powered By: <a href="http://mybbhacks.zingaburga.com/showthread.php?tid=288" target="_blank">XThreads</a>
    </div>
    {$inline_edit_js}

  2. resrev_forumdisplay_thread

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    <tr>
    	<td align="center" class="{$bgcolor}{$thread_type_class}" colspan="2">
    		{$GLOBALS['threadfields']['resrev_photo']['value']}
    	</td>
    	<td class="{$bgcolor}{$thread_type_class}">
    		{$attachment_count}
    		<div>
    			<span>{$prefix} {$gotounread}{$thread['threadprefix']}<a href="{$thread['threadlink']}" class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a>{$thread['multipage']}</span>
    			<div>{$GLOBALS['threadfields']['resrev_location']}</div>
    			<div class="author smalltext">{$lang->author}: {$thread['profilelink']}</div>
    			<div class="post_body">{$thread['postpreview']}</div>
    		</div>
    	</td>
    	<td align="center" class="{$bgcolor}{$thread_type_class}"><a href="javascript:MyBB.whoPosted({$thread['tid']});">{$thread['replies']}</a>{$unapproved_posts}</td>
    	<td align="center" class="{$bgcolor}{$thread_type_class}">{$thread['views']}</td>
    	{$rating}
    	<td class="{$bgcolor}{$thread_type_class}" style="white-space: nowrap; text-align: right;">
    		<span class="lastpost smalltext">{$lastpostdate} {$lastposttime}<br />
    		<a href="{$thread['lastpostlink']}">{$lang->lastpost}</a>: {$lastposterlink}</span>
    	</td>
    {$modbit}
    </tr>

  3. resrev_postbit_first

    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
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    {$ignore_bit}
    <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
    	<tbody>
    		<tr>
    			<td class="tcat">
    				<div class="float_left smalltext">
    					{$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
    				</div>
    				{$post['posturl']}
    			</td>
    		</tr>
    		<tr>
    			<td class="trow1 {$unapproved_shade}">
    				<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
    					<tr>
    						<td class="post_avatar" width="1" style="{$post['avatar_padding']}">
    							{$post['useravatar']}
    						</td>
    						<td class="post_author">
    							<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
    							<span class="smalltext">
    								{$post['usertitle']}<br />
    								{$post['userstars']}
    								{$post['groupimage']}
    							</span>
    						</td>
    						<td class="smalltext post_author_info" width="165">
    							{$post['user_details']}
    						</td>
    					</tr>
    				</table>
    			</td>
    		</tr>
    		<tr>
    			<td class="trow2 post_content {$unapproved_shade}">
    				<div class="float_right">{$GLOBALS['tplvars']['resrev_map']}</div>
    				<div class="float_left">{$GLOBALS['threadfields']['resrev_photo']['value']}</div>
    				<table border="0">
    					<tr>
    						<td colspan="2"><div class="largetext">{$post['subject']}</div></td>
    					</tr>
    					<tr>
    						<td colspan="2"><em>{$GLOBALS['threadfields']['resrev_location']}</em></td>
    					</tr>
    					{$GLOBALS['threadfields']['resrev_food']}
    					{$GLOBALS['threadfields']['resrev_service']}
    					{$GLOBALS['threadfields']['resrev_atm']}
    					{$GLOBALS['threadfields']['resrev_value']}
    				</table>
    				<br class="clear" />
    				<div class="post_body" id="pid_{$post['pid']}">
    					{$post['message']}
    				</div>
    				{$post['attachments']}
    				{$post['signature']}
    
    				<div class="post_meta" id="post_meta_{$post['pid']}">
    				{$post['iplogged']}
    				</div>
    			</td>
    		</tr>
    		<tr>
    			<td class="trow1 post_buttons {$unapproved_shade}">
    				<div class="author_buttons float_left">
    					{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
    				</div>
    				<div class="post_management_buttons float_right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>

  4. resrev_editpost_first

    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
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    <html>
    <head>
    <title>{$mybb->settings['bbname']} - {$lang->edit_post}</title>
    {$headerinclude}
    <script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript">
    var geocoder, map, map2;
    function initialize() {
    	geocoder = new google.maps.Geocoder();
    	
    	var myLatlng2 = new google.maps.LatLng{$GLOBALS['tplvars']['resrev_geo']};
    	var myOptions2 = {
    		zoom: 4,
    		center: myLatlng2,
    		mapTypeId: google.maps.MapTypeId.ROADMAP
    	}
    	map2 = new google.maps.Map(document.getElementById('map_geol'), myOptions2);
    	var marker2 = new google.maps.Marker({
    		position: myLatlng2, 
    		map: map2,
    		title:"{$thread['subject']}"
    	});
    
    	var myLatlng = new google.maps.LatLng{$GLOBALS['tplvars']['resrev_geo']};
    	var myOptions = {
    		zoom: 4,
    		center: myLatlng,
    		mapTypeId: google.maps.MapTypeId.ROADMAP
    	}
    	map = new google.maps.Map(document.getElementById('map_postbit'), myOptions);
    	var marker = new google.maps.Marker({
    		position: myLatlng, 
    		map: map
    	});
    }
    
    function codeAddress() {
    	var address = document.getElementById('xthreads_resrev_location').value;
    	geocoder.geocode({'address': address}, function(results, status) {
    		if (status == google.maps.GeocoderStatus.OK) {
    			var mylocation = results[0].geometry.location;
    			map2.setCenter(mylocation);
    			var marker3 = new google.maps.Marker({
    				map: map2,
    				position: mylocation
    			});
    			document.getElementsByName("xthreads_resrev_geo")[0].value = mylocation;
    		} else {
    			alert("Geocode was not successful for the following reason: " + status);
    		}
    	});
    }
    </script>
    </head>
    <body onload="initialize()">
    {$header}
    {$preview}
    {$post_errors}
    {$attacherror}
    <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" style="border-bottom: none;">
    	<tr>
    		<td class="thead" colspan="2"><strong>{$lang->edit_post}</strong></td>
    	</tr>
    	{$loginbox}
    </table>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top: none; border-bottom: none;">
    	<tr>
    		<td class="trow2" style="width: 50%; vertical-align: top;">
    			<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    				<tr>
    					<td class="trow2" colspan="2" style="text-align: center;">
    						<div id="map_geol" style="width:400px; height:250px;margin: auto auto;"></div>
    						{$tfinput['resrev_location']}
    					</td>
    				</tr>
    			</table>
    		</td>
    		<td class="trow2" style="vertical-align: top;">
    			<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    				<tr>
    					<td class="trow2" style="width: 20%; white-space:nowrap;"><strong>{$lang->subject}</strong></td>
    					<td class="trow2" style="white-space:nowrap;">{$prefixselect}<input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
    				</tr>
    				{$extra_threadfields}
    			</table>
    		</td>
    	</tr>
    </table>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top: none;">
    {$posticons}
    <tr>
    <td class="trow2" valign="top" style="width: 20%;"><strong>{$lang->your_message}:</strong><br /><div style="text-align: center;">{$smilieinserter}</div></td>
    <td class="trow2">
    <textarea name="message" id="message" rows="20" cols="70" tabindex="3">{$message}</textarea>
    {$codebuttons}
    </td>
    </tr>
    <tr>
    <td class="trow1" valign="top"><strong>{$lang->post_options}</strong></td>
    <td class="trow1"><span class="smalltext">
    <label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="6"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
    {$disablesmilies}</span>
    </td>
    </tr>
    {$subscriptionmethod}
    {$pollbox}
    </table>
    {$attachbox}
    <br />
    <div align="center"><input type="submit" class="button" name="submit" value="{$lang->update_post}" tabindex="3" accesskey="s" />  <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" /></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>
    <br />
    <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>
    {$footer}
    </body>
    </html>

  5. resrev_showthread

    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
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    <html>
    <head>
    <title>{$thread['subject']}</title>
    {$headerinclude}
    <script type="text/javascript">
    <!--
    	var quickdelete_confirm = "{$lang->quickdelete_confirm}";
    // -->
    </script>
    <script type="text/javascript" src="jscripts/thread.js?ver=1603"></script>
    {$GLOBALS['threadfields']['resrev_geo']}
    </head>
    <body onload="initialize()">
    {$header}
    {$pollbox}
    <div class="float_left">
    	{$multipage}
    
    </div>
    <div class="float_right">
    	{$newreply}
    </div>
    {$ratethread}
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both; border-bottom-width: 0;">
    	<tr>
    		<td class="thead" colspan="2">
    			<div style="float: right;">
    				<span class="smalltext"><strong><a href="showthread.php?mode=threaded&amp;tid={$tid}&amp;pid={$pid}#pid{$pid}">{$lang->threaded}</a> | <a href="showthread.php?mode=linear&amp;tid={$tid}&amp;pid={$pid}#pid{$pid}">{$lang->linear}</a></strong></span>
    			</div>
    			<div>
    				<strong>{$thread['threadprefix']}{$thread['subject']}</strong>
    			</div>
    		</td>
    	</tr>
    	{$classic_header}
    </table>
    <div id="posts">
    	{$first_post}{$posts}
    </div>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
    	<tr>
    		<td colspan="2" class="tfoot">
    			{$search_thread}
    			<div>
    				<strong>&laquo; <a href="{$next_oldest_link}">{$lang->next_oldest}</a> | <a href="{$next_newest_link}">{$lang->next_newest}</a> &raquo;</strong>
    			</div>
    		</td>
    	</tr>
    </table>
    <div class="float_left">
    	{$multipage}
    </div>
    <div style="padding-top: 4px;" class="float_right">
    	{$newreply}
    </div>
    <br style="clear: both;" />
    {$quickreply}
    {$threadexbox}
    {$similarthreads}
    <br />
    <div class="float_left">
    	<ul class="thread_tools">
    		<li class="printable"><a href="printthread.php?tid={$tid}">{$lang->view_printable}</a></li>
    		<li class="sendthread"><a href="sendthread.php?tid={$tid}">{$lang->send_thread}</a></li>
    		<li class="subscription_{$add_remove_subscription}"><a href="usercp2.php?action={$add_remove_subscription}subscription&amp;tid={$tid}&amp;my_post_key={$mybb->post_code}">{$add_remove_subscription_text}</a></li>
    	</ul>
    </div>
    
    <div class="float_right" style="text-align: right;">
    	{$moderationoptions}
    	{$forumjump}
    </div>
    <br style="clear: both;" />
    {$usersbrowsing}
    <div style="text-align:center" class="smalltext">
    {$forum['name']}<br />
    Powered By: <a href="http://mybbhacks.zingaburga.com/showthread.php?tid=288" target="_blank">XThreads</a>
    </div>
    {$footer}
    </body>
    </html>

  6. resrev_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
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    <html>
    <head>
    <title>{$lang->newthread_in}</title>
    {$headerinclude}
    <script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
    
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript">
    var geocoder, map, map2;
    function initialize() {
    	geocoder = new google.maps.Geocoder();
    	var geont = "{$GLOBALS['tplvars']['resrev_geo']}";
    	var myLatlng2 =  new google.maps.LatLng{$GLOBALS['tplvars']['resrev_geo']};
    	if(geont == ""){
    		myLatlng2 =  new google.maps.LatLng(0,0);
    	}
    	var myOptions2 = {
    		zoom: 4,
    		center: myLatlng2,
    		mapTypeId: google.maps.MapTypeId.ROADMAP
    	}
    	map2 = new google.maps.Map(document.getElementById('map_geol'), myOptions2);
    	var marker2 = new google.maps.Marker({
    		position: myLatlng2, 
    		map: map2
    	});
    	var myLatlng = new google.maps.LatLng{$GLOBALS['tplvars']['resrev_geo']};
    	var myOptions = {
    		zoom: 4,
    		center: myLatlng,
    		mapTypeId: google.maps.MapTypeId.ROADMAP
    	}
    	map = new google.maps.Map(document.getElementById('map_postbit'), myOptions);
    	var marker = new google.maps.Marker({
    		position: myLatlng, 
    		map: map
    	});
    }
    
    function codeAddress() {
    	var address = document.getElementById('xthreads_resrev_location').value;
    	geocoder.geocode({'address': address}, function(results, status) {
    		if (status == google.maps.GeocoderStatus.OK) {
    			var mylocation = results[0].geometry.location;
    			map2.setCenter(mylocation);
    			var marker3 = new google.maps.Marker({
    				map: map2,
    				position: mylocation
    			});
    			document.getElementsByName("xthreads_resrev_geo")[0].value = mylocation;
    		} else {
    			alert("Geocode was not successful for the following reason: " + status);
    		}
    	});
    }
    </script></head>
    <body onload="initialize()">
    {$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}" />
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-bottom: none;">
    	<tr>
    		<td class="thead" colspan="2"><strong>{$lang->post_new_thread}</strong></td>
    	</tr>
    	{$loginbox}
    </table>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top: none; border-bottom: none;">
    	<tr>
    		<td class="trow2" style="width: 50%; vertical-align: top;">
    			<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    				<tr>
    					<td class="trow2" colspan="2" style="text-align: center;">
    						<div id="map_geol" style="width:400px; height:250px;margin: auto auto;"></div>
    						{$tfinput['resrev_location']}
    					</td>
    				</tr>
    			</table>
    		</td>
    		<td class="trow2" style="vertical-align: top;">
    			<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    				<tr>
    					<td class="trow2" style="width: 20%; white-space:nowrap;"><strong>{$lang->thread_subject}</strong></td>
    					<td class="trow2" style="white-space:nowrap;">{$prefixselect}<input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" />
    					</td>
    				</tr>
    				{$extra_threadfields}
    			</table>
    		</td>
    	</tr>
    </table>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top: none;">
    {$posticons}
    <tr>
    <td class="trow2" valign="top" style="width: 20%;"><strong>{$lang->your_message}</strong>{$smilieinserter}</td>
    <td class="trow2">
    <textarea name="message" id="message" rows="20" cols="70" tabindex="2">{$message}</textarea>
    {$codebuttons}
    {$multiquote_external}
    </td>
    </tr>
    <tr>
    <td class="trow1" valign="top"><strong>{$lang->post_options}</strong></td>
    <td class="trow1"><span class="smalltext">
    <label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="7"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
    {$disablesmilies}</span></td>
    </tr>
    {$modoptions}
    {$subscriptionmethod}
    {$pollbox}
    {$captcha}
    </table>
    {$attachbox}
    <br />
    <div style="text-align:center"><input type="submit" class="button" name="submit" value="{$lang->post_thread}" tabindex="4" accesskey="s" />  <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="5" />{$savedraftbutton}</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>

  7. resrev_postbit_first_classic

    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
    {$ignore_bit}
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
    	<tr>
    		<td class="{$altbg}" width="15%" valign="top" style="white-space: nowrap; text-align: center;"><a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    		<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
    		<span class="smalltext">
    			{$post['usertitle']}<br />
    			{$post['userstars']}
    			{$post['groupimage']}
    			{$post['useravatar']}<br />
    			{$post['user_details']}
    		</span>
    	</td>
    	<td class="{$altbg}" valign="top">
    		<table width="100%">
    			<tr><td>{$post['posturl']}
    			<br class="clear" />
    			<div class="float_right">{$GLOBALS['tplvars']['resrev_map']}</div>
    			<div class="float_left">{$GLOBALS['threadfields']['resrev_photo']['value']}</div>
    			<table border="0">
    				<tr>
    					<td colspan="2"><div class="largetext">{$post['subject']}</div></td>
    				</tr>
    				<tr>
    					<td colspan="2"><em>{$GLOBALS['threadfields']['resrev_location']}</em></td>
    				</tr>
    				{$GLOBALS['threadfields']['resrev_food']}
    				{$GLOBALS['threadfields']['resrev_service']}
    				{$GLOBALS['threadfields']['resrev_atm']}
    				{$GLOBALS['threadfields']['resrev_value']}
    			</table>
    			<br class="clear" />
    			<div id="pid_{$post['pid']}" class="post_body">
    				{$post['message']}
    			</div>
    			{$post['attachments']}
    			{$post['signature']}
    			<div style="text-align: right; vertical-align: bottom;" id="post_meta_{$post['pid']}">
    				<div id="edited_by_{$post['pid']}">{$post['editedmsg']}</div>
    				{$post['iplogged']}
    			</div>
    		</td></tr>
    	</table>
    </td>
    </tr>
    <tr>
    	<td class="{$altbg}" style="white-space: nowrap; text-align: center; vertical-align: middle;"><span class="smalltext">{$post['postdate']} {$post['posttime']}</span></td>
    	<td class="{$altbg}" style="vertical-align: middle;">
    		<table width="100%" border="0" cellpadding="0" cellspacing="0">
    			<tr valign="bottom">
    				<td align="left" ><span class="smalltext">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}</span></td>
    				<td align="right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}</td>
    			</tr>
    		</table>
    	</td>
    </tr>
    </table>



That's the basic of our Restaurant Review forum. Just modify it as our needs.
Please tell me if there is something wrong with the code above. I'm still learning.

Screenshots:
1. Threadlist
   

2. Newthread
   

3. Showthread
   

(This post was last modified: 08-08-2012 08:02 AM by RateU.)
08-03-2012 07:35 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Restaurant Review - RateU - 08-03-2012 07:35 AM
RE: Restaurant Review - Jumper - 08-06-2012, 01:46 PM
RE: Restaurant Review - ZiNgA BuRgA - 08-06-2012, 03:45 PM
RE: Restaurant Review - RateU - 08-07-2012, 03:49 AM
RE: Restaurant Review - Jumper - 08-08-2012, 05:30 AM
RE: Restaurant Review - RateU - 08-08-2012, 06:43 AM
RE: Restaurant Review - Jumper - 08-08-2012, 07:39 AM
RE: Restaurant Review - RateU - 08-08-2012, 08:04 AM
RE: Restaurant Review - Jumper - 08-08-2012, 08:27 AM
RE: Restaurant Review - RateU - 08-09-2012, 04:14 AM
RE: Restaurant Review - Jumper - 08-10-2012, 01:24 PM
RE: Restaurant Review - WhiteEagle - 08-11-2012, 03:50 AM
RE: Restaurant Review - RateU - 08-11-2012, 05:45 AM
RE: Restaurant Review - WhiteEagle - 08-11-2012, 04:34 PM
RE: Restaurant Review - RateU - 08-12-2012, 05:03 AM
RE: Restaurant Review - WhiteEagle - 08-12-2012, 09:10 AM
RE: Restaurant Review - WhiteEagle - 09-02-2012, 04:58 AM
RE: Restaurant Review - RateU - 09-02-2012, 06:27 AM
RE: Restaurant Review - WhiteEagle - 09-02-2012, 06:35 AM
RE: Restaurant Review - RateU - 09-02-2012, 11:42 PM
RE: Restaurant Review - WhiteEagle - 09-03-2012, 12:32 AM
RE: Restaurant Review - RateU - 09-03-2012, 12:50 AM
RE: Restaurant Review - WhiteEagle - 09-03-2012, 01:48 AM
RE: Restaurant Review - RateU - 09-03-2012, 03:18 AM
RE: Restaurant Review - WhiteEagle - 09-03-2012, 02:43 PM
RE: Restaurant Review - ZiNgA BuRgA - 09-03-2012, 03:01 PM
RE: Restaurant Review - WhiteEagle - 09-03-2012, 03:46 PM
RE: Restaurant Review - RateU - 09-04-2012, 01:29 AM
RE: Restaurant Review - WhiteEagle - 09-04-2012, 03:45 AM
RE: Restaurant Review - ZiNgA BuRgA - 09-04-2012, 08:09 AM
RE: Restaurant Review - WhiteEagle - 09-05-2012, 12:16 PM
RE: Restaurant Review - isoka - 04-08-2013, 12:28 AM
RE: Restaurant Review - RateU - 04-08-2013, 01:01 AM
RE: Restaurant Review - isoka - 04-08-2013, 05:13 AM
RE: Restaurant Review - RateU - 04-08-2013, 05:21 AM
RE: Restaurant Review - lenox - 06-24-2018, 06:47 PM
RE: Restaurant Review - Lordikon30 - 01-11-2020, 12:44 PM
RE: Restaurant Review - Lordikon30 - 01-21-2020, 06:43 AM
RE: Restaurant Review - Lordikon30 - 01-24-2020, 09:23 AM
RE: Restaurant Review - RateU - 04-26-2020, 03:19 AM
RE: Restaurant Review - lenox - 06-17-2020, 02:22 AM
RE: Restaurant Review - RateU - 06-21-2020, 06:01 AM
RE: Restaurant Review - lenox - 06-21-2020, 11:15 PM
RE: Restaurant Review - RateU - 06-22-2020, 01:11 AM
RE: Restaurant Review - lenox - 06-22-2020, 04:43 AM
RE: Restaurant Review - RateU - 06-22-2020, 04:47 AM

 Standard Tools
Forum Jump: