Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 30th, 2002, 12:32 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Article Discussion: Simple PHP Templates With PatTemplate

Simple PHP Templates With PatTemplate

Phew, finally able to visit devarticles.com again.. The DNS server I was using never updated itself.. so all I got was a blank page.. oh well..

If you have any questions or comments for this article or topic, please post them here.

You can read the article here .
__________________
Best Regards,
Hvard Lindset

Reply With Quote
  #2  
Old July 6th, 2002, 03:42 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Havard,

I'm having a little trouble with alternating my row colors.... I'm starting to lose my mind!

Here's the code:
Table
PHP Code:
<patTemplate:tmpl name="list" type="OddEven">
<
patTemplate:sub condition="odd">
<
tr>
        <
td bgcolor="#d5dfef"><a href="editclient.php?id={CLIENTID}">{CLIENTNAME}</a></td>
        <
td bgcolor="#d5dfef"><a href="mailto:{CLIENTEMAIL}">{CLIENTCONTACT}</a></td>
</
tr>
</
patTemplate:sub>
<
patTemplate:sub condition="even">
<
tr>
        <
td bgcolor="#d9d9d9"><a href="editclient.php?id={CLIENTID}">{CLIENTNAME}</a></td>
        <
td bgcolor="#d9d9d9"><a href="mailto:{CLIENTEMAIL}">{CLIENTCONTACT}</a></td>
</
tr>
</
patTemplate:sub>
</
patTemplate:tmpl


Script
PHP Code:
while ($row mysql_fetch_array($result)){
    
$clientId $row["clientId"];
    
$clientName $row["clientName"];
    
$clientContact $row["clientContact"];
    
$clientEmail $row["clientEmail"];

    
$template->addVar("list""CLIENTID"$clientId);
    
$template->addVar("list""CLIENTNAME"$clientName);
    
$template->addVar("list""CLIENTCONTACT"$clientContact);
    
$template->addVar("list""CLIENTEMAIL"$clientEmail);

    
$template->parseTemplate("list""a");
                                    
}

$template->DisplayParsedTemplate("listclients"); 


Any help would be appreciated. I only have it displaying in one color. Any ideas?
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #3  
Old July 6th, 2002, 04:25 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Hi Frank,

I've had problems with that too.. A solution might be to dynamically generate an array with all of the values, then use the addVars() function..

the array has to be an associative array like this:

array(CLIENTID => array(1, 2, 3),
CLIENTNAME => array("Client1", "Client2", "Client3")
);

Hope it works out for you

Reply With Quote
  #4  
Old July 6th, 2002, 04:30 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Quote:
Originally posted by Lindset
Hi Frank,

I've had problems with that too.. A solution might be to dynamically generate an array with all of the values, then use the addVars() function..

the array has to be an associative array like this:

array(CLIENTID => array(1, 2, 3),
CLIENTNAME => array("Client1", "Client2", "Client3")
);

Hope it works out for you


I'm not sure if I know what you mean... What would replace "Client1", "Client2", etc? Are those the hardcoded values, or variables?

I'm somewhat in a bind... using the templates has made certain aspects so much easier, but in other respects, it's a pain in the a*s! :P

Any help would be great! TIA!

Reply With Quote
  #5  
Old July 6th, 2002, 04:32 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Here's something you can do.. just an example

PHP Code:
while ($row mysql_fetch_array($result)) {
    
$return['username'][] = $row['username'];
    
$return['password'][] = $row['password'];
}
    
$tmpl->addVars("namelist"$return); 


I just had to test it myself before I posted it here

Last edited by Lindset : July 6th, 2002 at 04:35 PM.

Reply With Quote
  #6  
Old July 6th, 2002, 04:36 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Quote:
Originally posted by Lindset
Here's something you can do.. just an example

PHP Code:
while ($row mysql_fetch_array($resultMYSQL_ASSOC)) {
    
$return['username'][] = $row['username'];
    
$return['password'][] = $row['password'];



I just had to test it myself before I posted it here


Does that assign $row['username]' to the 2nd [], and so on? I get too confused when dealing with multi-dimensional arrays....

Reply With Quote
  #7  
Old July 6th, 2002, 04:40 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to Lindset Send a message via AIM to Lindset
If you execute these lines of code:
$array['somename'][] = "Yes";
$array['somename'][] = "Sir";
$array['blah'][] = "Test";
$array['blah'][] = "Me";

The value of:
$array['somename'][0] would be "Yes"
$array['somename'][1] would be "Sir"
$array['blah'][0] would be "Test"
$array['blah'][1] would be "Me"

When you use [] it will be applied at the end of the array..

Reply With Quote
  #8  
Old July 6th, 2002, 04:44 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Here's the code that would make the alterning colors work for you.

PHP Code:
while ($row mysql_fetch_array($result)){
    
$clientId $row["clientId"];
    
$clientName $row["clientName"];
    
$clientContact $row["clientContact"];
    
$clientEmail $row["clientEmail"];
    
    
$list['CLIENTID'][] = $clientId;
    
$list['CLIENTNAME'][] = $clientName;
    
$list['CLIENTCONTACT'][] = $clientContact;
    
$list['CLIENTEMAIL'][] = $clientEmail;                                    
}

$tmpl->addVars("list"$list);
$template->DisplayParsedTemplate("listclients"); 


It should work..

Reply With Quote
  #9  
Old July 6th, 2002, 04:45 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Ahh... Okay, so in the case of:

PHP Code:
while ($row mysql_fetch_array($resultMYSQL_ASSOC)) {
    
$return['username'][] = $row['username'];
    
$return['password'][] = $row['password'];



It's taking the value of "username" and "password" in each row, and assigning it to "$return['username'][0], $return['password'][0]" and "[1][1]" for the next row and so on?

Now when you called:

PHP Code:
 tmpl->addVars("namelist"$return


Does it automatically assume ALL arrays with the prefix "$return" to replace those values?

Reply With Quote
  #10  
Old July 6th, 2002, 04:46 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Quote:
It's taking the value of "username" and "password" in each row, and assigning it to "$return['username'][0], $return['password'][0]" and "[1][1]" for the next row and so on?


Correct

Reply With Quote
  #11  
Old July 6th, 2002, 04:49 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Quote:
Originally posted by Lindset
Here's the code that would make the alterning colors work for you.

PHP Code:
while ($row mysql_fetch_array($result)){
    
$clientId $row["clientId"];
    
$clientName $row["clientName"];
    
$clientContact $row["clientContact"];
    
$clientEmail $row["clientEmail"];
    
    
$list['CLIENTID'][] = $clientId;
    
$list['CLIENTNAME'][] = $clientName;
    
$list['CLIENTCONTACT'][] = $clientContact;
    
$list['CLIENTEMAIL'][] = $clientEmail;                                    
}

$tmpl->addVars("list"$list);
$template->DisplayParsedTemplate("listclients"); 


It should work..


BEEEEUUUUUUTTTTTIIIIIIFFFFFUUUUULLLL!!

It worked... i understand that a lot more now! So by using multi-dimensional arrays, I can store the value of each row's column into a separate element?

Thank you for the help! I would have gone bald soon!

Reply With Quote
  #12  
Old July 8th, 2002, 03:03 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to Lindset Send a message via AIM to Lindset
To everyone that's interested in patTemplate:
http://www.php-tools.de/xena/apps/f...aarticleid=----

Reply With Quote
  #13  
Old August 12th, 2002, 11:35 PM
alfatek alfatek is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 2 alfatek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i guess this is tricky but here goes...

There is any simple way to do a menu like this:

-> Category 1
---> Product 1
---> Product 2
---> Product 3
-> Category 2
---> Product 1

....

the template i'm using is:
PHP Code:
<patTemplate:tmpl name="category">
                    <
br />Category: -> {CATEGORY}<br /
                            <
patTemplate:tmpl name="product">
                            <
br /><br />{NAME} - {PRICE}
                            </
patTemplate:tmpl>
            </
patTemplate:tmpl


I don't want to do many dirty php, i prefer that the template system work for me...

I only had 1 idea, but it requires conditional statements in the PHP:
do a while statement that for each category it parses the template category with the append option, and do a AddVars to the products so that they loop...


What would be the best is to loop the categorys and patTemplate does an auto loop of the products also, using only a multi-dimensional array like this:
PHP Code:
 $foo[CATEGORY1][PRODUCT1][PRICE] = "1";
$foo[CATEGORY1][PRODUCT1][NAME] = "bar";
$foo[CATEGORY1][PRODUCT2][PRICE] = "2";
$foo[CATEGORY1][PRODUCT2][NAME] = "bar2";
$foo[CATEGORY2][PRODUCT1][PRICE] = "2.2";
$foo[CATEGORY2][PRODUCT1][NAME] = "bar2.2"

Do you know if patTemplate can do this, nested blocks of looping code...

Reply With Quote
  #14  
Old September 9th, 2002, 07:29 AM
david david is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Berlin
Posts: 3 david User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question patTemplate error

Hi Lindset,

I have some trouble using the patTemplate.

When I changed the php.ini ( setting an extension Dir ; activate some modules) my scripts retuned a lot of errors. Mainly errors concerning the patTemplate.php file.

like this :

Warning: Undefined offset: -1 in \..\patTemplate.php on line 447

Warning: Use of undefined constant keep - assumed 'keep' in \..\patTemplate.php on line 469

Warning: Undefined index: keep in \..\patTemplate.php on line 469

Warning: Use of undefined constant whitespace - assumed 'whitespace' in \..\patTemplate.php on line 550

Warning: Undefined index: whitespace in \..\patTemplate.php on line 550

Warning: Undefined offset: -1 in \..\patTemplate.php on line 554

Warning: Use of undefined constant name - assumed 'name' in \..\patTemplate.php on line 563

Warning: Use of undefined constant name - assumed 'name' in \..\patTemplate.php on line 566

Warning: Use of undefined constant type - assumed 'type' in \..\patTemplate.php on line 578

Warning: Undefined index: type in \..\patTemplate.php on line 578

Warning: Use of undefined constant type - assumed 'type' in \..\patTemplate.php on line 586

Warning: Use of undefined constant src - assumed 'src' in \..\patTemplate.php on line 591

Warning: Undefined index: src in \..\patTemplate.php on line 591

Warning: Undefined index: varscope in \..\patTemplate.php on line 343

Warning: Undefined property: dependencies in /\..\patTemplate.php on line 1220


Im using foxserv : Apache 1.3.22 and PHP 4.1...

so what can I do?

so long,
david

Reply With Quote
  #15  
Old September 9th, 2002, 09:00 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
David,

What were the exact changes you made in the PHP.ini file? Also, can you post a piece of the code (preferably the part where you are including the patTemplate class file). This will help us determine the problem.

Reply With Quote
  #16  
Old September 10th, 2002, 03:22 AM
david david is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Berlin
Posts: 3 david User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi FrankieShades,

this is how I include the patTemplate file:

include("patTemplate.php");

some parts of the ini file :
(although Im not sure if everything was changed, cause a friend tried to help me out )...

----------------------------------------

error_reporting = E_ALL
display_errors = On
display_startup_errors = On

register_globals = Off
register_argc_argv = Off

..the extension dir was changed...
the upload_temp_dir also

Windows Extensions:

php_gd.dll
php_pdf.dll


------------------------------

these are the changes we have made.

hope I got them all.

David

Reply With Quote
  #17  
Old September 10th, 2002, 06:50 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Have you tried putting the PHP.ini file back the way it originally was and running the script?

Also, make sure that the patTemplate.php class file is in the current directory as the script, otherwise you'll have to do this:

include("<pathToClass>/patTemplate.php");

Reply With Quote
  #18  
Old September 16th, 2002, 10:11 AM
david david is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Berlin
Posts: 3 david User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink thx frankie

Hiho,

I think my php.ini settings are too strict, causphp wants every variable to be defined before its called.
The patTemplate.php obviously doesnt do that ( see error log ^

I tried the Smarty template which works fine. i can only recommend it.
URL

thx for your replies

seeya
david

Reply With Quote
  #19  
Old September 16th, 2002, 10:21 AM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to Lindset Send a message via AIM to Lindset
It's a known issue about patTemplate (saw the author mention it on the official site).. Btw, I'm using Smarty now too..

Reply With Quote
  #20  
Old April 14th, 2003, 03:01 PM
torrent torrent is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 19 torrent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I've got a bit of an odd problem I hope someone can help me out with. I am using patTemplate and, for the most part, quite like it.

I want to be able to "switch in" one of two links depending on a value passed to the sub template. I have already have one sub template
being called and that works fine but when I add the one for the 'register' link I get weird results, such as both links showing an EID value
of 4 (the link looks like: register.php?eid={EID}, where the {EID} should read 4 on one table row and 5 on the next). I am including the
template below as well as the php code. Apologies in advance for the length of this post.

Code:
<!-- MAIN_EVENTS TEMPLATE -->
<patTemplate:tmpl name="main_events">
<table width="100%" border="1" cellspacing="0" cellpadding="6">
  <tr>
    <td><div align="center">Date</div></td>
    <td><div align="center">Event Name</div></td>
    <td><div align="center">Location</div></td>
    <td><div align="center">Confirmed</div></td>
    <td><div align="center">Contact</div></td>
    <td><div align="center">Un/Register</div></td>
  </tr>

  <!-- construct rows containing the parsed data (see below) -->
  <patTemplate:link src="main_event_data" />  

</table>
</patTemplate:tmpl>


<!-- MAIN_EVENT_DATA TEMPLATE -->
<patTemplate:tmpl name="main_event_data" type="condition" conditionvar="DATA"> 
 
  <!-- Sub Template activated if parsed value DATA contains the string 'events' -->
  <patTemplate:sub condition="events">
  <tr>
    <td><div align="center">{DATE}</div></td>
    <td>{EVENT}</td>
    <td>{LOCATION}</td>
    <td><div align="center">{CONF}</div></td>
    <td><div align="center"><a href="contact.php?mid={CONTACT}">Contact the organiser</a></div></td>

    <!-- link to sub template which will determine which link to display (see below) -->
    <patTemplate:link src="main_register" /> 

  </tr>
  </patTemplate:sub> 
 
  <!-- Sub Template activated if parsed var DATA contains the string 'noevents' -->
  <patTemplate:sub condition="noevents">
  <tr>
    <td colspan="6"><div align="center">There are no main events to display</td>  
  </tr>
  </patTemplate:sub>

</patTemplate:tmpl>


<!-- MAIN_REGISTER TEMPLATE -->
<patTemplate:tmpl name="main_register" type="condition" conditionvar="ACTION">

  <!-- Sub Template activated if parsed var ACTION contains the string 'register' -->
  <patTemplate:sub condition="register">
    <td><div align="center"><a href="register.php?eid={EID}&act=reg">Click to register</a></div></td>
  </patTemplate:sub>

  <!-- Sub Template activated if parsed var ACTION contains the string 'unregister' -->
  <patTemplate:sub condition="unregister">
    <td><div align="center"><a href="register.php?eid={EID}&act=unreg">Click to unregister</a></div></td>
  </patTemplate:sub>

</patTemplate:tmpl>
...and here's the PHP code. Take note in particular at the parsedTemplate() lines as I believe this is where the problem lies somehow.
PHP Code:
//
  // build main events table
  //
  
$sql       "SELECT * FROM Events WHERE R_ID = 'GL'"// Global events are denoted by a Region ID of 'GL'
  
$result    mysql_query($sql) or logError("Unable to build main events table! Query Fail: [".mysql_error()."]");
  
$numEvents mysql_num_rows($result);  

  if (
$numEvents 0) {  

    
$template->addVar('main_event_data''DATA''events');
  
    for (
$x 0$x <= $numEvents-1; ++$x) {
      
// process an event
      
$row mysql_fetch_object($result);

      
// count the number of confirmed members for this event
      
$sql     "SELECT COUNT(confirmed) as confirmed FROM eventstatus WHERE E_ID = '$row->ID' AND Confirmed = '1'";
      
$result2 mysql_query($sql) or logError("Failed to count the number of confirmed members for event [$row->event], event ID [$row->id]. Query Failed: [".mysql_error()."]");
      
$row2    mysql_fetch_object($result2);

      
// has the member already registered for this event?
      
$sql     "SELECT COUNT(*) as numRegistered FROM eventstatus WHERE M_ID = '$_SESSION[m_id]' AND E_ID = '$row->ID' AND Confirmed = '1'"
      
$result3 mysql_query($sql) or logError("Failed to determine member's event status! Query Fail: [".mysql_error()."]");
      
$row3    mysql_fetch_object($result3);
      
      
// used for constructing link and text in the un/registered column
      //$action  = ($row3->E_ID > 0) ? "unregister" : "register";
      
$action  = ($row3->numRegistered 0) ? "unregister" "register";

      
// if logged in member id matches the member id for the event then hyperlink to the edit page else hyperlink to event information
      
$eventName = ($_SESSION['m_id'] == $row->Contact) ? '<a href="editEvent.php?eid=' $row->ID "\">$row->Event_Name</a>" "<a href=\"dispDesc.php?eid=$row->ID\" onclick=\"NewWindow(this.href,'Event Information','400','400','yes');return false;\">$row->Event_Name</a>";
      
      
// if number of confirmed is greater than 0 then hyperlink to the list of confirmed members page
      
$confirmed = ($row2->confirmed 0) ? "<a href=\"dispConfirmed.php?eid=$row->ID\">$row2->confirmed</a>" 0;

      
$date mkDate($row->Date);
      
      
$template->addVar('main_event_data''EVENT'$eventName);
      
$template->addVar('main_event_data''DATE'$date);
      
$template->addVar('main_event_data''LOCATION'$row->Location);
      
$template->addVar('main_event_data''CONF'$confirmed);
      
$template->addVar('main_register''EID'$row->ID);
      
$template->addVar('main_register''ACTION'$action);
      
$template->addVar('main_register''CONTACT'$row->Contact);
      
$template->parseTemplate('main_event_data''a');
      
$template->parseTemplate('main_register''a'); //places the unregister or register link      

    
}
    
  } else {
 
    
$template->addVar('main_event_data''DATA''noevents');        

  } 
Would most appreciate any help with this.
Thanks in advance.

Reply With Quote
  #21  
Old April 15th, 2003, 04:05 PM
torrent torrent is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 19 torrent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorted!

Reply With Quote
  #22  
Old July 17th, 2004, 07:36 PM
Cyclops Cyclops is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 Cyclops User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Template linking

Lindset,

In this article, you mentioned something about how you split up your files into
header, footer and content or body ( IIRC ). I was wondering if you could go into
more detail about that in relation to patTemplate. Are you then able to view the
html document and see the full page or do you have to view each part of the page
separately? Thank you so much for any clarification that you can give us.

Cy
Cyclops - TNtech
http://travelersnetwork.net

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Article Discussion: Simple PHP Templates With PatTemplate


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap