Page 1 of 1

Please help - Display data in 2 colums rather than 1

Posted: Fri Apr 23, 2010 2:19 pm
by leemp5
Hi guys.
I have a script that calls up a number of entries from a database and displays them in a table as you can see below. Im trying to get the script to display the entries in 2 table colums rather than just the 1. I beleive i need to add a bit of php in order to dot his however i have no php experiance.
The code that displays the data is as follows:

Code: Select all

			<h4><span>{$dtphrase.showcase_entries}</span></h4>
			<div class="table-wrap">
				<table cellspacing="0" cellpadding="0">
					<tr>
						<th class="col1" scope="col">{$dtphrase.domain_name_label}</th>
						<th class="col2" scope="col">{$dtphrase.min_offer_label}</th>
						<th class="col3" scope="col">{$dtphrase.bin_price_label}</th>
					</tr>
                    {section name="i" loop=$showcase_entries}
                    {cycle values="even,odd" assign="rowclass"}
					<tr class="{$rowclass}">
						<td><a href="{$sitevar.site_url}/{if $sitevar.seo_friendly_urls eq "1"}{$sitevar.seo_friendly_dir}/{$showcase_entries[i].id}/{$showcase_entries[i].domain}{else}details.php?id={$showcase_entries[i].id}{/if}">{$showcase_entries[i].domain}</a></td>
						<td>{if $sitevar.display_currency_symbol eq "1"} {$showcase_entries[i].currency_symbol}{/if}{$showcase_entries[i].minimum_offer|number_format:$sitevar.number_format_decimal_places:$sitevar.number_format_decimal_seperator:$sitevar.number_format_thousands_seperator} {if $sitevar.display_currency_code eq "1"} {$showcase_entries[i].currency}{/if}</td>
						<td>{if $sitevar.display_currency_symbol eq "1"} {$showcase_entries[i].currency_symbol}{/if}{$showcase_entries[i].bin_price|number_format:$sitevar.number_format_decimal_places:$sitevar.number_format_decimal_seperator:$sitevar.number_format_thousands_seperator} {if $sitevar.display_currency_code eq "1"} {$showcase_entries[i].currency}{/if}</td>
					</tr>
                    {sectionelse}
                    <tr>
                      <td colspan="3"><div align="center">{$dtphrase.no_showcase_entries}</div></td>
                    </tr>
                    {/section}
					<tr class="lastrow">
						<td colspan="3"><p class="fl"><a href="{$sitevar.site_url}/add.php?mode=adddomain">{$dtphrase.enter_domains}</a></p>
							<p class="fr"><a href="{$sitevar.site_url}/search.php?mode=morelistings&id=showcase">{$dtphrase.more_listings}</a></p></td>
					</tr>
				</table>
			</div>
I have tried many html options but all i can manage to do is duplicate the entries.
Please could somebody help me with this?
Thanks

Re: Please help - Display data in 2 colums rather than 1

Posted: Fri Apr 23, 2010 5:47 pm
by mecha_godzilla
The problem you've got here is that the 'repeating' element of your script is based on table rows rather than columns. In your repeating element, to do what you want you need a way to add the table row (<tr>) tag only once, the table column (<td> and </td>) twice - and only twice - and then the closing table row (</tr>) once. You also need some error handling to create an empty set of table column (<td> and </td>) tags if the results are odd, otherwise the table won't be written correctly.

I can't tell from the template what application you're using but the program 'logic' will need to be in the script that calls this template as it's unlikely you'd be able to include any PHP code in the template. If you can find out which of your scripts calls this template then it might be a good idea to post it up here and then myself or someone else could make some suggestions. The idea of having the script and template separate is that it makes it easier to separate the code from the layout, but the flipside of this is that the template is 'dumb' and can't do anything that isn't defined in the script. The code that's used in your template is not PHP but some custom code designed by the developer that 'parses' the template and lets the script know where it needs to insert the live data.

HTH,

Mecha Godzilla

Re: Please help - Display data in 2 colums rather than 1

Posted: Sat Apr 24, 2010 4:28 am
by leemp5
Hi Mecha,
Thanks for the reply, that was interesting to know, its helped me understand the script a bit better. The code i pasted in the first post was the home page from the templates section.
Iv dug a little deeper and found the following code which is the actual index.php file. You can see it has a direct reference to loadin showcase entries:

Code: Select all

<?php
// ######################### DEFINE CONSTANTS ############################
define('SCRIPT_NAME','index');

// ######################### REQUIRE BACKEND #############################
require_once('./includes/globals.php');
require_once('./classes/smarty.class.php');
require_once('./classes/main.class.php');

// Initiate class(es):
$smartyBuild = new smartyBuild($dbh);
$domTrader = new domTrader($dbh,$smartyBuild);

// ######################### GET INDEX STUFF #############################
$smarty->register_resource("db", array($smartyBuild, 'fetch_smarty_template','fetch_smarty_timestamp','fetch_smarty_secure','fetch_smarty_trusted'));
// Assign smarty vars
$smartyBuild->AssignSmartyVars($smarty,SCRIPT_NAME);
$smarty->assign('latest_entries',$domTrader->LoadLatestEntries());
$smarty->assign('showcase_entries',$domTrader->LoadShowcaseEntries());
$smarty->assign('auctions',$domTrader->LoadLatestAuctions());
$smarty->assign('latest_sales',$domTrader->LoadLatestSales());
$smarty->assign('banners',$domTrader->LoadBanners());
$smarty->assign('side_categories',$domTrader->FetchIndexCategories());
$smarty->assign('categories',$domTrader->FetchCategories());
$smarty->display('db:'.SCRIPT_NAME);
?>
I ran a search on the entire script for the entry "ShowCase" and it turned up in only one other document called "main.class.php". I think this may be the one that the template calls up its values from:

Code: Select all

	* Function to load showcase domains
	* @param null
	* @return array Domain array
    */
	function LoadShowcaseEntries(){
		$results = $this->dbh->getAll("select 
			".TABLE_PREFIX."showcase.end_date,
			".TABLE_PREFIX."domains.*,
			".TABLE_PREFIX."currencies.symbol as currency_symbol from ".TABLE_PREFIX."domains 
			left join ".TABLE_PREFIX."showcase on ".TABLE_PREFIX."showcase.domain = ".TABLE_PREFIX."domains.domain 
			left join ".TABLE_PREFIX."currencies on ".TABLE_PREFIX."currencies.code = ".TABLE_PREFIX."domains.currency
			where end_date > now() and active='1' order by rand() 
			limit ".$this->sitevar['showcase_entries_domain_limit'], DB_FETCHMODE_ASSOC);
		return $results;
	}
Do you think it is php that i need to do what i am trying or is it simply a html issue?
Thanks for you help.

Re: Please help - Display data in 2 colums rather than 1

Posted: Sat Apr 24, 2010 3:22 pm
by mecha_godzilla
There's nothing in either of those two bits of code that's going to help you I'm afraid. What you're looking for is the template file itself (I would assume there's a different template for each page) and the file that calls it. As an example, with something like phpBB you have:

1. a main file (such as viewforum.php) that the browser runs whenever someone enters http://www.nonexistentsite.com/forums/viewforum.php and this file contains most of the program logic related to retrieving the forums data from the database

2. viewforum.php will then call another file such as includes/page_header.php and this is then used to generate all the page header tags (<html> and <head> </head> tags as well as load the stylesheets, etc.)

3. viewforum.php will then create an array called $template and load the contents of the templates/viewforum_body.tpl file into it

4. viewforum.php will then search through the copy of viewforum_body.tpl it stored in the $template array and replace all the 'placeholder' values with the live data

Note that the template file (viewforum_body.tpl) is saved in HTML and doesn't contain any PHP code. If you open the file you see normal HTML code together with some commented text that looks like

Code: Select all

<!-- BEGIN switch_no_topics -->
and values that look like

Code: Select all

{PAGE_NUMBER}
These are the placeholders that viewforum.php uses to tell it where to insert the real data or which elements need to repeat.

I would suggest that whatever application you're using probably does things in a similar way so you need to start by looking to see if there are any template folders. If you can tell me what application you're using I could probably download it and see how it works (I'm on a very slow connection though so if it's more than a few megs it's not going to happen!)

HTH,

Mecha Godzilla

Re: Please help - Display data in 2 colums rather than 1

Posted: Sat Apr 24, 2010 3:46 pm
by leemp5
Thanks again for your help.
Im using the domain trader script brought out by smart script solutions, its one that i had to pay around £600 for so it is unavailable to download. The way the script is put together is very complicated. Where usual scripts have a file for each page template this script has all of the templates in one database, and to edit each template you have to log in via the admin to access the code for the page you are looking for. Also the pages do not use just one template, for example the homepage is plit into 3 templates called header, index, and footer.
Very complicated and unorthadox. My brother also has the same script and his web developer absolutley hates it. If i had known the script to be like this i never would have purchased it.
The very first peice of code i posted was taken from index template, I will include all 3 templates below to represent the entire home page below, but please note the only part of the code i am trying to edit is the showcase domains section.

Header Code

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={$sitevar.charset}">
<title>{$sitevar.site_name} - {$dtphrase.page_title}</title>
{$cssvar.page_name}
{$javavar.page_name}
</head>
<body id="home">
<div id="outer">
	<h1><a href="{$sitevar.site_url}/index.php">{$dtphrase.index_top_phrase}<em></em></a></h1>
	<p class="ad468">
      {if count($banners) > 0}
        <a href="{$banners.destination}" target="_blank"><img src="{$sitevar.banner_upload_url}/{$banners.location}" alt="{$banners.name}" /></a>
      {/if}
    </p>
	<div id="nav">
		<div>
			<ul>
              {if $smarty.const.SCRIPT_NAME eq "index"}
                <li class="current"><a href="{$sitevar.site_url}/index.php">{$dtphrase.header_home_link}</a></li>
              {else}
                <li><a href="{$sitevar.site_url}/index.php">{$dtphrase.header_home_link}</a></li>
              {/if}
              {if $smarty.const.SCRIPT_NAME eq "buydomains"}
                <li class="current"><a href="{$sitevar.site_url}/buydomains.php">{$dtphrase.header_buydomains_link}</a></li>
              {else}
                <li><a href="{$sitevar.site_url}/buydomains.php">{$dtphrase.header_buydomains_link}</a></li>
              {/if}
              {if $smarty.const.SCRIPT_NAME eq "selldomains"}
                <li class="current"><a href="{$sitevar.site_url}/selldomains.php">{$dtphrase.header_selldomains_link}</a></li>
              {else}
                <li><a href="{$sitevar.site_url}/selldomains.php">{$dtphrase.header_selldomains_link}</a></li>
              {/if}
              {if $smarty.const.SCRIPT_NAME eq "parkdomains"}
                <li class="current"><a href="{$sitevar.site_url}/parkdomains.php">{$dtphrase.header_parkdomains_link}</a></li>
              {else}
                <li><a href="{$sitevar.site_url}/parkdomains.php">{$dtphrase.header_parkdomains_link}</a></li>
              {/if}
              {if $smarty.const.SCRIPT_NAME eq "search"}
                <li class="current"><a href="{$sitevar.site_url}/search.php">{$dtphrase.header_search_link}</a></li>
              {else}
                <li><a href="{$sitevar.site_url}/search.php">{$dtphrase.header_search_link}</a></li>
              {/if}
              {if $smarty.const.SCRIPT_NAME eq "aboutus"}
                <li class="current"><a href="{$sitevar.site_url}/aboutus.php">{$dtphrase.header_aboutus_link}</a></li>
              {else}
                <li><a href="{$sitevar.site_url}/aboutus.php">{$dtphrase.header_aboutus_link}</a></li>
              {/if}
              {if $smarty.const.SCRIPT_NAME eq "contactus"}
                <li class="current"><a href="{$sitevar.site_url}/contactus.php">{$dtphrase.header_contactus_link}</a></li>
              {else}
                <li><a href="{$sitevar.site_url}/contactus.php">{$dtphrase.header_contactus_link}</a></li>
              {/if}
                {assign var=user_session value=$sitevar.session_name}
				{if isset($smarty.session.$user_session)}
                  {if $smarty.const.SCRIPT_NAME eq "usercp" || 
                  $smarty.const.SCRIPT_NAME eq "add" || 
                  $smarty.const.SCRIPT_NAME eq "manage" || 
                  $smarty.const.SCRIPT_NAME eq "offers" ||
                  $smarty.const.SCRIPT_NAME eq "sales" ||
                  $smarty.const.SCRIPT_NAME eq "messages" ||
                  $smarty.const.SCRIPT_NAME eq "billing" ||
                  $smarty.const.SCRIPT_NAME eq "deposit" ||
                  $smarty.const.SCRIPT_NAME eq "withdraw"}
                    <li class="current"><a href="{$sitevar.site_url}/login.php">{$dtphrase.header_myaccount_link}</a></li>
                  {else}
                    <li><a href="{$sitevar.site_url}/login.php">{$dtphrase.header_myaccount_link}</a></li>
                  {/if}
                {else}
                  {if $smarty.const.SCRIPT_NAME eq "login" || $smarty.const.SCRIPT_NAME eq "register"}
                    <li class="current"><a href="{$sitevar.site_url}/login.php">{$dtphrase.header_login_link}</a></li>
                  {else}
                    <li><a href="{$sitevar.site_url}/login.php">{$dtphrase.header_login_link}</a></li>
                  {/if}
                {/if}
			</ul>
		</div>
	</div>
	<div id="main">
Index Code

Code: Select all

<h2>{$dtphrase.welcome_head}</h2>
		<div class="intro">
		  {$dtphrase.welcome_text}
		</div>
		<div class="search">
			<h3>{$dtphrase.search_head}</h3>
			<form id="search" method="get" action="{$sitevar.site_url}/search.php">
            <input type="hidden" name="mode" value="searchresults" />
				<div class="search-inner">
					<input class="inp170" type="text" name="keywords" id="keywords" />
					in
					<select name="category" id="category">
						<option value="allcat">{$dtphrase.all_categories}</option>
                        {section name="i" loop=$categories}
                          <option value="{$categories[i].id}">{$categories[i].category}</option>
                        {/section}
					</select>
					<input type="image" class="inpHov" name="imageField" id="imageField" src="{$sitevar.site_url}/images/search.gif" />
					<a href="{$sitevar.site_url}/search.php?mode=advancedsearch">{$dtphrase.advanced_search}</a></div>
			</form>
		</div>
		<!-- 4 tables floated side by side in rows of two.-->
		<div class="entries left-entry">
			<h4><span>{$dtphrase.latest_entries}</span></h4>
			<div class="table-wrap">
				<table cellspacing="0" cellpadding="0">
					<tr>
						<th class="col1" scope="col">{$dtphrase.domain_name_label}</th>
						<th class="col2" scope="col">{$dtphrase.min_offer_label}</th>
						<th class="col3" scope="col">{$dtphrase.bin_price_label}</th>
					</tr>
                    {section name="i" loop=$latest_entries}
                    {cycle values="even,odd" assign="rowclass"}
                    <tr class="{$rowclass}">
						<td><a href="{$sitevar.site_url}/{if $sitevar.seo_friendly_urls eq "1"}{$sitevar.seo_friendly_dir}/{$latest_entries[i].id}/{$latest_entries[i].domain}{else}details.php?id={$latest_entries[i].id}{/if}">{$latest_entries[i].domain}</a></td>
						<td>{if $sitevar.display_currency_symbol eq "1"} {$latest_entries[i].currency_symbol}{/if}{$latest_entries[i].minimum_offer|number_format:$sitevar.number_format_decimal_places:$sitevar.number_format_decimal_seperator:$sitevar.number_format_thousands_seperator}{if $sitevar.display_currency_code eq "1"} {$latest_entries[i].currency}{/if}</td>
						<td>{if $sitevar.display_currency_symbol eq "1"} {$latest_entries[i].currency_symbol}{/if}{$latest_entries[i].bin_price|number_format:$sitevar.number_format_decimal_places:$sitevar.number_format_decimal_seperator:$sitevar.number_format_thousands_seperator}{if $sitevar.display_currency_code eq "1"} {$latest_entries[i].currency}{/if}</td>
					</tr>
                    {sectionelse}
                    <tr>
                      <td colspan="3"><div align="center">{$dtphrase.no_latest_entries}</div></td>
                    </tr>
                    {/section}
					<tr class="lastrow">
						<td colspan="3"><p class="fl"><a href="{$sitevar.site_url}/add.php?mode=adddomain">{$dtphrase.enter_domains}</a></p>
							<p class="fr"><a href="{$sitevar.site_url}/search.php?mode=morelistings&id=latest">{$dtphrase.more_listings}</a></p></td>
					</tr>
				</table>
			</div>
			<div class="tablebase"></div>
		</div>
		<!-- end entry-->
		<div class="entries">
			<h4><span>{$dtphrase.showcase_entries}</span></h4>
			<div class="table-wrap">
				<table cellspacing="0" cellpadding="0">
					<tr>
						<th class="col1" scope="col">{$dtphrase.domain_name_label}</th>
						<th class="col2" scope="col">{$dtphrase.min_offer_label}</th>
						<th class="col3" scope="col">{$dtphrase.bin_price_label}</th>
					</tr>
                    {section name="i" loop=$showcase_entries}
                    {cycle values="even,odd" assign="rowclass"}
					<tr class="{$rowclass}">
						<td><a href="{$sitevar.site_url}/{if $sitevar.seo_friendly_urls eq "1"}{$sitevar.seo_friendly_dir}/{$showcase_entries[i].id}/{$showcase_entries[i].domain}{else}details.php?id={$showcase_entries[i].id}{/if}">{$showcase_entries[i].domain}</a></td>
						<td>{if $sitevar.display_currency_symbol eq "1"} {$showcase_entries[i].currency_symbol}{/if}{$showcase_entries[i].minimum_offer|number_format:$sitevar.number_format_decimal_places:$sitevar.number_format_decimal_seperator:$sitevar.number_format_thousands_seperator} {if $sitevar.display_currency_code eq "1"} {$showcase_entries[i].currency}{/if}</td>
						<td>{if $sitevar.display_currency_symbol eq "1"} {$showcase_entries[i].currency_symbol}{/if}{$showcase_entries[i].bin_price|number_format:$sitevar.number_format_decimal_places:$sitevar.number_format_decimal_seperator:$sitevar.number_format_thousands_seperator} {if $sitevar.display_currency_code eq "1"} {$showcase_entries[i].currency}{/if}</td>
					</tr>
                    {sectionelse}
                    <tr>
                      <td colspan="3"><div align="center">{$dtphrase.no_showcase_entries}</div></td>
                    </tr>
                    {/section}
					<tr class="lastrow">
						<td colspan="3"><p class="fl"><a href="{$sitevar.site_url}/add.php?mode=adddomain">{$dtphrase.enter_domains}</a></p>
							<p class="fr"><a href="{$sitevar.site_url}/search.php?mode=morelistings&id=showcase">{$dtphrase.more_listings}</a></p></td>
					</tr>
				</table>
			</div>
			<div class="tablebase"></div>
		</div>
		<!-- end entry-->
		<div class="clear"></div>
		<div class="entries left-entry">
			<h4><span>{$dtphrase.auctions}</span></h4>
			<div class="table-wrap">
				<table cellspacing="0" cellpadding="0">
					<tr>
						<th class="col1" scope="col">{$dtphrase.domain_name_label}</th>
						<th class="col2" scope="col">{$dtphrase.offer_label}</th>
						<th class="col3" scope="col">{$dtphrase.time_left_label}</th>
					</tr>
                    {section name="i" loop=$auctions}
                    {cycle values="even,odd" assign="rowclass"}
					<tr class="{$rowclass}">
						<td><a href="{$sitevar.site_url}/{if $sitevar.seo_friendly_urls eq "1"}{$sitevar.seo_friendly_dir}/{$auctions[i].id}/{$auctions[i].domain}{else}details.php?id={$auctions[i].id}{/if}">{$auctions[i].domain}</a></td>
						<td>{if $sitevar.display_currency_symbol eq "1"} {$auctions[i].currency_symbol}{/if}{$auctions[i].high_bid|number_format:$sitevar.number_format_decimal_places:$sitevar.number_format_decimal_seperator:$sitevar.number_format_thousands_seperator}{if $sitevar.display_currency_code eq "1"} {$auctions[i].currency}{/if}</td>
						<td>{convert_time_left seconds=$auctions[i].time_left days_phrase=$dtphrase.days_phrase day_phrase=$dtphrase.day_phrase hour_phrase=$dtphrase.hour_phrase min_phrase=$dtphrase.min_phrase}</td>
					</tr>
                    {sectionelse}
                    <tr>
                      <td colspan="3"><div align="center">{$dtphrase.no_auctions}</div></td>
                    </tr>
                    {/section}
					<tr class="lastrow">
						<td colspan="3"><p class="fl"><a href="{$sitevar.site_url}/add.php?mode=adddomain">{$dtphrase.enter_domains}</a></p>
							<p class="fr"><a href="{$sitevar.site_url}/search.php?mode=morelistings&id=auctions">{$dtphrase.more_listings}</a></p></td>
					</tr>
				</table>
			</div>
			<div class="tablebase"></div>
		</div>
		<!-- end entry-->
		<div class="entries">
			<h4><span>{$dtphrase.latest_sales}</span></h4>
			<div class="table-wrap">
				<table cellspacing="0" cellpadding="0">
					<tr>
						<th class="col1" scope="col">{$dtphrase.domain_name_label}</th>
						<th class="col2" scope="col">{$dtphrase.sale_price_label}</th>
					</tr>
                    {section name="i" loop=$latest_sales}
                    {cycle values="even,odd" assign="rowclass"}
					<tr class="{$rowclass}">
						<td>{$latest_sales[i].domain}</td>
						<td class="col2">{if $sitevar.display_currency_symbol eq "1"} {$latest_sales[i].currency_symbol}{/if}{$latest_sales[i].price|number_format:$sitevar.number_format_decimal_places:$sitevar.number_format_decimal_seperator:$sitevar.number_format_thousands_seperator}{if $sitevar.display_currency_code eq "1"} {$latest_sales[i].currency}{/if}</td>
					</tr>
                    {sectionelse}
                    <tr>
                      <td colspan="2"><div align="center">{$dtphrase.no_sales}</div></td>
                    </tr>
                    {/section}
					<tr class="lastrow">
						<td colspan="2"><p class="fr">&nbsp;</p></td>
					</tr>
				</table>
			</div>
			<div class="tablebase"></div>
		</div>
		<!-- end entry-->
Footer Code

Code: Select all

</div>
	<!-- end main -->
	<div id="sidebar">
		<div class="login headbar">
          {if isset($smarty.session.$user_session)}
            <h4><span>{$dtphrase.footer_tools_header}</span></h4>
              <div class="log clearfix">
                <ul>
                  <li><strong><a href="{$sitevar.site_url}/usercp.php?mode=loggedin">{$dtphrase.footer_account_home_link}</a></strong></li>
                  <li><a href="{$sitevar.site_url}/add.php?mode=adddomain">{$dtphrase.footer_add_domain_link}</a></li>
                  <li><a href="{$sitevar.site_url}/manage.php?mode=managedomains">{$dtphrase.footer_manage_domain_link}</a></li>
                  <li><a href="{$sitevar.site_url}/manage.php?mode=manageparkeddomains">{$dtphrase.footer_domain_parking_link}</a></li>
                  <li><a href="{$sitevar.site_url}/offers.php?mode=viewoffersmade">{$dtphrase.footer_offersmade_link}</a></li>
                  <li><a href="{$sitevar.site_url}/offers.php?mode=viewoffersreceived">{$dtphrase.footer_offersreceived_link}</a></li>
                  <li><a href="{$sitevar.site_url}/sales.php?mode=viewdomainsales">{$dtphrase.footer_sales_link}</a></li>
                  <li><a href="{$sitevar.site_url}/messages.php?mode=viewmessages">{$dtphrase.footer_messages_link}</a></li>
                  <li><a href="{$sitevar.site_url}/billing.php?mode=viewbilling">{$dtphrase.footer_billing_link}</a></li>
                  <li><a href="{$sitevar.site_url}/deposit.php?mode=deposit">{$dtphrase.footer_deposit_link}</a></li>
                  <li><a href="{$sitevar.site_url}/withdraw.php?mode=withdraw">{$dtphrase.footer_withdraw_link}</a></li>
                  <li><a href="{$sitevar.site_url}/usercp.php?mode=editacctinfo">{$dtphrase.footer_acct_info_link}</a></li>
                  <li><a href="{$sitevar.site_url}/usercp.php?mode=logout">{$dtphrase.footer_logout_link}</a></li>
                </ul>
              </div>
          {else}
			<h4><span>{$dtphrase.footer_login_header}</span></h4>
			<form class="loginform" id="memberlogin" method="post" action="{$sitevar.site_url}/login.php">
            <input type="hidden" name="mode" value="login" />
            {if $smarty.get.return}<input type="hidden" name="return" value="{$smarty.get.return}">{/if}
				<div class="log clearfix">
					<label for="username">{$dtphrase.footer_username}</label>
					<input class="inp170" type="text" name="user_name" id="user_name" />
					<label for="password">{$dtphrase.footer_password}</label>
					<input class="inp170" type="password" name="password" id="password" />
					<input type="submit" class="logsub" name="button"  value="Login" />
					<a href="{$sitevar.site_url}/register.php">{$dtphrase.footer_not_member}</a><br />
					<a href="{$sitevar.site_url}/recoverlogin.php">{$dtphrase.footer_lost_pw}</a> </div>
				<div class="joinnow headbar headjoin">
					<h4><span>{$dtphrase.footer_join_now}</span></h4>
					<div>
						<p>{$dtphrase.footer_join_phrase}</p>
					</div>
					<p class="join-dom">
						<a href="register.php"><img src="{$sitevar.site_url}/images/join.gif" class="inpHov" name="imageField2" id="imageField2" /></a>
					</p>
				</div>
			</form>
          {/if}
		</div>
		<div class="base200"></div>
		<div class="categories headbar">
			<h4><span>{$dtphrase.footer_categories_header}</span></h4>
			<div class="cat">
				<ul>
                  {section name="i" loop=$side_categories}
					<li><a href="{$sitevar.site_url}/search.php?mode=viewcat&id={$side_categories[i].id}">{$side_categories[i].category}</a></li>
                  {/section}
                  <li class="view-all">
                    {if isset($smarty.session.side_categories)}
                      <a href="{$sitevar.site_url}/search.php?mode=mincats">{$dtphrase.footer_show_min_cats}&hellip;</a>
                    {else}
                      <a href="{$sitevar.site_url}/search.php?mode=showallcats">{$dtphrase.footer_view_all_cat}&hellip;</a>
                    {/if}
                  </li>
				</ul>
			</div>
		</div>
        <div class="base200"></div>
        {if $smarty.const.SCRIPT_NAME eq "manage"}
        <div class="iconkey headbar">
			<h4><span>Icon Key</span></h4>
			<div class="sideicons">
				<ul>
                  <li class="left"><img src="{$sitevar.icon_auction_image}" border="0" /></li>
                  <li class="right">{$dtphrase.icon_status_domainonauction}</li>
                  <li class="left"><img src="{$sitevar.icon_active_image}" border="0" /></li>
                  <li class="right">{$dtphrase.icon_status_domainisactive}</li>
                  <li class="left"><img src="{$sitevar.icon_inactive_image}" border="0" /></li>
                  <li class="right">{$dtphrase.icon_status_domainisinactive}</li>
                  <li class="left"><img src="{$sitevar.icon_showcase_image}" border="0" /></li>
                  <li class="right">{$dtphrase.icon_status_domaininshowcase}</li>
                  <li class="left"><img src="{$sitevar.icon_sold_image}" border="0" /></li>
                  <li class="right">{$dtphrase.icon_status_domainmarkedsold}</li>
                  <li class="left"><img src="{$sitevar.icon_parked_image}" border="0" /></li>
                  <li class="right">{$dtphrase.icon_status_domainisparked}</li>
				</ul>
			</div>
		</div>
		<div class="base200"></div>
        {/if}
	</div>
	<!-- end sidebar -->
<div id="footer">
		<div>
			<ul>
				<li><a href="{$sitevar.site_url}/index.php">{$dtphrase.footer_home_link}</a> - </li>
				<li><a href="{$sitevar.site_url}/buydomains.php">{$dtphrase.footer_buy_link}</a> - </li>
				<li><a href="{$sitevar.site_url}/selldomains.php">{$dtphrase.footer_sell_link}</a> - </li>
				<li><a href="{$sitevar.site_url}/parkdomains.php">{$dtphrase.footer_park_link}</a> - </li>
				<li><a href="{$sitevar.site_url}/search.php">{$dtphrase.footer_search_link}</a> - </li>
				<li><a href="{$sitevar.site_url}/aboutus.php">{$dtphrase.footer_about_link}</a> - </li>
				<li><a href="{$sitevar.site_url}/contactus.php">{$dtphrase.footer_contact_link}</a> - </li>
				<li><a href="{$sitevar.site_url}/login.php">{$dtphrase.footer_login_register_link}</a></li>
			</ul>
		</div>
	</div>
</div>
<div class="copyright">
	<p><a href="{$sitevar.site_url}/index.php"><img src="{$sitevar.site_url}/images/logo2.jpg" alt="{$sitevar.site_name}" /></a></p>
	<p>{$sitevar.site_copyright}</p>
    <p>{if $sitevar.page_load_time eq 1}{page_load_time start=$page_load_start}{/if}</p>
</div>
</body>
</html>
It may be that I will have to pay the script developer to do the mod for me, however im always keen to ask for help on the forums and give it a go myself, I actually learn what im doing then :)

Thanks again.

Re: Please help - Display data in 2 colums rather than 1

Posted: Sun Apr 25, 2010 4:52 pm
by mecha_godzilla
Assuming it's not urgent I'll have a look at that later on tomorrow if I may to see what's going on in those scripts - I'm not really "in the zone" enough to make any sensible suggestions this evening :)

Personally, I hate working with third-party scripts. E-commerce ones tend to be the worst (Actinic, I'm looking at YOU here!) and I specifically learned PHP and MySQL so I can write my own if needed. osCommerce is another abomination* as it's a horrible mish-mash of hard-coded HTML and PHP all haphazardly slammed together over about 100 files. After spending about 10 minutes looking at the files I felt slightly ill, then deleted it all off of my hard drive - always trust your gut instinct!

Anyway, enough ranting - I'll try and have some answers for you tomorrow.

Mecha Godzilla

* Please note that I'm entitled to my own opinions on these matters, and in any case I'm right

Re: Please help - Display data in 2 colums rather than 1

Posted: Mon Apr 26, 2010 4:28 pm
by mecha_godzilla
Hi again,

I've looked through all the code but I can't see any obvious way to do what you need. The problem is that the HTML template only offers a very limited amount of controls, which are:

1. showing one type of layout if any results are found, and a different one if no results are found

2. switching the style settings for the table rows between two different values (presumably to give them a different alternating background colour)

You said in one of your other posts that you can only access the templates through the database, but is this your database or do they run everything from their own one? Did they install the software for you? The PHP scripts must reside somewhere (I don't think they'd store them in the database in any case) so you need to find out where these are kept. If it's on their system then you probably can't modify them anyway. You *could* try adding some PHP code to the main template to see if anything happens though - on your 'footer' template, where you've got

Code: Select all

<div class="copyright">
        <p><a href="{$sitevar.site_url}/index.php"><img src="{$sitevar.site_url}/images/logo2.jpg" alt="{$sitevar.site_name}" /></a></p>
        <p>{$sitevar.site_copyright}</p>
    <p>{if $sitevar.page_load_time eq 1}{page_load_time start=$page_load_start}{/if}</p>
</div>
</body>
</html>
amend it so it looks like

Code: Select all

<div class="copyright">

<?php echo('test<br />'); ?>

        <p><a href="{$sitevar.site_url}/index.php"><img src="{$sitevar.site_url}/images/logo2.jpg" alt="{$sitevar.site_name}" /></a></p>
        <p>{$sitevar.site_copyright}</p>
    <p>{if $sitevar.page_load_time eq 1}{page_load_time start=$page_load_start}{/if}</p>
</div>
</body>
</html>
If you just see the word test followed by your copyright notice underneath it then you can use PHP in your templates, but if you just see <?php echo('test<br />'); ?> followed by your copyright notice then the PHP isn't being processed.

Sorry if that isn't much help but your options are limited if you don't have access to the scripts themselves.

Mecha Godzilla