Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: anycontent.php  (Read 3149 times)

0 Members and 1 Guest are viewing this topic.

CaptainBlue

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 13
    • Captain Blue's Page o' Crap
anycontent.php
« on: February 18, 2005, 03:07:15 pm »

I've added anycontent.php to my page layout and that's fine.

But now I want two tables of information, so I've written it like this:
Code: [Select]
<?php
starttable
("100%""Latest Trackday Photos");

?>

<tr><td class="tableb" >
<ul>
<li>The day after each Folly trackday, we'll be adding a hyperlink in this section that links to DE Photo's
 website from where you'll be able to order prints</li>
</ul>
</td></tr>
<?php
endtable
();
?>


<?php
starttable
("100%""Notes");

?>

<tr><td class="tableb" >
<ul>
<li>Registered and logged-in users can send photos as e-cards<br />
- makes a change from cartoons or slick commercial ones!</li>
<li>Your e-card recipient's details will not be used or sold on by the Motorcycle Folly</li>
</ul>
</td></tr>
<?php
endtable
();

?>


Now that works OK, but I'd like to add the equivalent of two or three line breaks between the two tables. What's the syntax for this? Any help much appreciated.
« Last Edit: February 18, 2005, 05:17:05 pm by GauGau »
Logged
Richard Morris

CaptainBlue

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 13
    • Captain Blue's Page o' Crap
Re: anycontent.php
« Reply #1 on: February 18, 2005, 03:44:03 pm »

As a temporary workaround, I've added this code:
Code: [Select]
<?php echo '-'?>
This puts a hyphen in between the two tables - using simply
Code: [Select]
<?php echo ' '?>did nothing.
Logged
Richard Morris

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: anycontent.php
« Reply #2 on: February 18, 2005, 04:59:06 pm »

Just use plain html:
Quote
<?php
starttable("100%", "Latest Trackday Photos");

?>
<tr><td class="tableb" >
<ul>
<li>The day after each Folly trackday, we'll be adding a hyperlink in this section that links to DE Photo's
website from where you'll be able to order prints</li>
</ul>
</td></tr>
<?php
endtable();
?>
<br />&nbsp;<br />&nbsp;<br />
<?php
starttable("100%", "Notes");

?>
<tr><td class="tableb" >
<ul>
<li>Registered and logged-in users can send photos as e-cards<br />
- makes a change from cartoons or slick commercial ones!</li>
<li>Your e-card recipient's details will not be used or sold on by the Motorcycle Folly</li>
</ul>
</td></tr>
<?php
endtable();

?>

Using PHP would be the very same thing: just make it output the line breaks, like this
Code: [Select]
[quote]<?php
starttable
("100%""Latest Trackday Photos");
?>

<tr><td class="tableb" >
<ul>
<li>The day after each Folly trackday, we'll be adding a hyperlink in this section that links to DE Photo's
website from where you'll be able to order prints</li>
</ul>
</td></tr>
<?php
endtable
();
print 
'<br />&nbsp;<br />&nbsp;<br />';
starttable("100%""Notes");
?>

<tr><td class="tableb" >
<ul>
<li>Registered and logged-in users can send photos as e-cards<br />
- makes a change from cartoons or slick commercial ones!</li>
<li>Your e-card recipient's details will not be used or sold on by the Motorcycle Folly</li>
</ul>
</td></tr>
<?php
endtable
();
?>

You have to understand how PHP works: just like in html, where commands between < and > are used to delimit page content from tags, PHP is being switched on and off using <?php and ?>. Recommended reading to get you started: http://www.php.net/manual/en/language.basic-syntax.php#language.basic-syntax.phpmode

Joachim[/quote]
« Last Edit: February 18, 2005, 05:05:22 pm by GauGau »
Logged

CaptainBlue

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 13
    • Captain Blue's Page o' Crap
Re: anycontent.php
« Reply #3 on: February 18, 2005, 05:16:05 pm »

Thanks for that: I'd tried adding some line breaks but they'd failed for me. The PHP option worked, however, with just one line break being needed so the code now goes like this:
Code: [Select]
<?php
starttable
("100%""Latest Trackday Photos");

?>

<tr><td class="tableb" >
<ul>
<li>The day after each Folly trackday, we'll be adding a hyperlink in this section that links to DE Photo's
 website from where you'll be able to order prints</li>
</ul>
</td></tr>
<?php
endtable
();
print 
'&nbsp;<br />';

starttable("100%""Notes");

?>

<tr><td class="tableb" >
<ul>
<li>Registered and logged-in users can send photos as e-cards<br />
- makes a change from cartoons or slick commercial ones!</li>
<li>Your e-card recipient's details will not be used or sold on by the Motorcycle Folly</li>
</ul>
</td></tr>
<?php
endtable
();

?>

Logged
Richard Morris
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.