MyBB Hacks

Full Version: Restaurant Review
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
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:
      <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
    <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
    <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
    {$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
    <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
    <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
    <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
    {$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
[attachment=882]

2. Newthread
[attachment=883]

3. Showthread
[attachment=884]
very very nice RateU Yes

1. what must i change to see this in vertical layout? you use horizontal postbit.
2. one error (but only one time) if you click on "preview post" at the headline.
if you open the thread again and click again on preview post, all is fine! bug is only the first time.

[attachment=886]

3. what can be the reason for this optical bug (blank line between atmosphere and value) ?

[attachment=887]
Looks nice RateU - thanks for sharing!
(08-06-2012 01:46 PM)Jumper Wrote: [ -> ]1. what must i change to see this in vertical layout? you use horizontal postbit.
I've added the resrev_postbit_first_classic template to the first post.
Just modify it as your needs.

(08-06-2012 01:46 PM)Jumper Wrote: [ -> ]2. one error (but only one time) if you click on "preview post" at the headline.
if you open the thread again and click again on preview post, all is fine! bug is only the first time.
I thought that I've fixed the problem. Edit your resrev_newthread template. Find {$GLOBALS['threadfields']['resrev_geo']} code inside the header tag. Replace it with {$GLOBALS['tplvars']['resrev_geo']}
I should be similar to your resrev_editpost_first template.
I've edited the template in the first post.
I'm really sorry for the mistake.

(08-06-2012 01:46 PM)Jumper Wrote: [ -> ]3. what can be the reason for this optical bug (blank line between atmosphere and value) ?
Not quite sure about this one. Could you please post your test thread URL here?

@Yumi: Thanks, Yumi Biggrin
now all is working fine. big thx RateU Wink

(08-07-2012 03:49 AM)RateU Wrote: [ -> ]Not quite sure about this one. Could you please post your test thread URL here?

normally this forum is not visible for guests. i open the sub-forum, so that you can see what i mean.
btw: i use your mod not only for restaurants, i use it for all shops and places. so the users can post all places.
example: cinemas, shops, disco etc.
the 4 rating categories are no more a requiered field, and the users select only the fields which match with the categorie. Smile

http://oxygen-scene.com/forum/showthread.php?tid=712
I'm sorry, but did you fix your blank line between atmosphere and value issue? I can't see the blank line between atmosphere and value ratings there.
No, but now i know the problem Biggrin

my browser is opera, and i think your browser is firefox.
in firefox it looks fine. in opera and chrome you see the blank line.

would be better, that all people are using only ONE browser wordwide Biggrin

sry, but normally i test all mods with 4 browser (FF, Opera, Chrome and IE), but this time i've forgotten it.
Ah yes. I only test it using FF and IE6 (I only have these browsers).
Try the update template (I've updated the template in the first post).
yepp, it works now in Opera and Chrome Yes thx RateU Wink

(08-08-2012 08:04 AM)RateU Wrote: [ -> ]...I only test it using FF and IE6

IE6 ? sure? Biggrin not mean IE9? ^^
(08-08-2012 08:27 AM)Jumper Wrote: [ -> ]IE6 ? sure?
Yep.
Pages: 1 2 3 4 5
Reference URL's