zero-perfoliate
zero-perfoliate

Author Topic: images and text  (Read 3096 times)

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: images and text
« Reply #30 on: March 08, 2009, 03:05:09 PM »
try this:

Code: [Select]
<?php
$pageTitle 
"The Sydney Papers Online";
$pageClass "pub";
include 
"includes/common.php";
include 
"includes/header9.php";
?>

<div id="link_to_login"><a href="../mm2/register.php"><img src="../images/imageSPonline.jpg"/></a></div>
   
    <?php


echo "\n <h2>The Sydney Papers <span class=\"title\">Online</span></h2>\n";

$vlist mysql_query("SELECT * FROM v ORDER BY vdate DESC");
if (
mysql_num_rows($vlist)>=1) {
echo " <dl class=\"spList\">\n";

while ($v mysql_fetch_array($vlist)) {



$vdate $v['vdate'];
$year substr($vdate04);
$month substr($vdate42);
$day substr($vdate62);
$date date('jS F Y'mktime(000$month$day$year));

$image  = ($v['vimg'] !="") ? "<span class=\"vimg\"><img src=\"downloads/images/$v[vimg]\" width=\"80\" height=\"110\" alt=\"Picture of $v[vname]\" /></span>" "";

echo 
"&nbsp";


echo "<div id=\"article_menu\">\n";
echo" <ul id=\"listoflists\">";
echo" <li class=\"topic\"><h1>Issue</h1>";
echo" <ul class=\"article_list\">";
echo" <li class=\"article_link\">"
echo" <p class=\"folio\"><span style=\"color:#A2A2A2;\">$date</span></p>\n";
echo" <h2>$image</h2>";
echo" <p class=\"byline\">by $v[vname]</p>";
echo" <p class=\"abstract\"> $v[vexcerpt]</p>";
echo" <p class=\"read_link\"><a href=\"spmemContent.php?vid=$v[vid]\" title=\"Read more...\">Read more...</a></p>";
echo" </li>";
echo" </div>";



   }
   echo 
"</dl>\n";
} else {
   echo 
"<p>There are currently no papers listed in the database.</p>\n";
}


include 
"includes/footer.php";
?>



Offline viren.nathoo

  • PHP Workers
  • **
  • Posts: 21
  • Karma: +0/-0
Re: images and text
« Reply #31 on: March 08, 2009, 03:25:37 PM »
Thanks for your reply.

I have that change but now that has given me another error.

http://www.thesydneyinstitute.com.au/sponline.php -> Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 39

Any ideas how to recify this?

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: images and text
« Reply #32 on: March 08, 2009, 04:00:33 PM »
think the arrays needed to be escaped try this:

Code: [Select]
<?php
$pageTitle 
"The Sydney Papers Online";
$pageClass "pub";
include 
"includes/common.php";
include 
"includes/header9.php";
?>

<div id="link_to_login"><a href="../mm2/register.php"><img src="../images/imageSPonline.jpg"/></a></div>
   
    <?php


echo "\n <h2>The Sydney Papers <span class=\"title\">Online</span></h2>\n";

$vlist mysql_query("SELECT * FROM v ORDER BY vdate DESC");
if (
mysql_num_rows($vlist)>=1) {
echo " <dl class=\"spList\">\n";

while ($v mysql_fetch_array($vlist)) {



$vdate $v['vdate'];
$year substr($vdate04);
$month substr($vdate42);
$day substr($vdate62);
$date date('jS F Y'mktime(000$month$day$year));

$image  = ($v['vimg'] !="") ? "<span class=\"vimg\"><img src=\"downloads/images/".$v[vimg]."\" width=\"80\" height=\"110\" alt=\"Picture of ".$v[vname]."\" /></span>" "";

echo 
"&nbsp";


echo "<div id=\"article_menu\">\n";
echo" <ul id=\"listoflists\">";
echo" <li class=\"topic\"><h1>Issue</h1>";
echo" <ul class=\"article_list\">";
echo" <li class=\"article_link\">"
echo" <p class=\"folio\"><span style=\"color:#A2A2A2;\">$date</span></p>\n";
echo" <h2>$image</h2>";
echo" <p class=\"byline\">by ".$v[vname]."</p>";
echo" <p class=\"abstract\">".$v[vexcerpt]."</p>";
echo" <p class=\"read_link\"><a href=\"spmemContent.php?vid=".$v[vid]."\" title=\"Read more...\">Read more...</a></p>";
echo" </li>";
echo" </div>";



   }
   echo 
"</dl>\n";
} else {
   echo 
"<p>There are currently no papers listed in the database.</p>\n";
}


include 
"includes/footer.php";
?>



Offline viren.nathoo

  • PHP Workers
  • **
  • Posts: 21
  • Karma: +0/-0
Re: images and text
« Reply #33 on: March 08, 2009, 04:16:53 PM »
no luck.

still got this same problem

Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 38

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: images and text
« Reply #34 on: March 08, 2009, 04:44:15 PM »
arggh it needed a semi-colon at the end of line 37 I missed it till now.

Here's the updated code:

Code: [Select]
<?php
$pageTitle 
"The Sydney Papers Online";
$pageClass "pub";
include 
"includes/common.php";
include 
"includes/header9.php";
?>

<div id="link_to_login"><a href="../mm2/register.php"><img src="../images/imageSPonline.jpg"/></a></div>
   
    <?php


echo "\n <h2>The Sydney Papers <span class=\"title\">Online</span></h2>\n";

$vlist mysql_query("SELECT * FROM v ORDER BY vdate DESC");
if (
mysql_num_rows($vlist)>=1) {
echo " <dl class=\"spList\">\n";

while ($v mysql_fetch_array($vlist)) {



$vdate $v['vdate'];
$year substr($vdate04);
$month substr($vdate42);
$day substr($vdate62);
$date date('jS F Y'mktime(000$month$day$year));

$image  = ($v['vimg'] !="") ? "<span class=\"vimg\"><img src=\"downloads/images/".$v[vimg]."\" width=\"80\" height=\"110\" alt=\"Picture of ".$v[vname]."\" /></span>" "";

echo 
"&nbsp";


echo "<div id=\"article_menu\">\n";
echo" <ul id=\"listoflists\">";
echo" <li class=\"topic\"><h1>Issue</h1>";
echo" <ul class=\"article_list\">";
echo" <li class=\"article_link\">";
echo" <p class=\"folio\"><span style=\"color:#A2A2A2;\">$date</span></p>\n";
echo" <h2>$image</h2>";
echo" <p class=\"byline\">by ".$v[vname]."</p>";
echo" <p class=\"abstract\">".$v[vexcerpt]."</p>";
echo" <p class=\"read_link\"><a href=\"spmemContent.php?vid=".$v[vid]."\" title=\"Read more...\">Read more...</a></p>";
echo" </li>";
echo" </div>";



   }
   echo 
"</dl>\n";
} else {
   echo 
"<p>There are currently no papers listed in the database.</p>\n";
}


include 
"includes/footer.php";
?>



Offline viren.nathoo

  • PHP Workers
  • **
  • Posts: 21
  • Karma: +0/-0
Re: images and text
« Reply #35 on: March 08, 2009, 05:11:34 PM »
Hi there

Thanks for your help again. The problem is that no data is being retrieved from the sql database. Also i recieved the following errors.

Notice: Use of undefined constant vimg - assumed 'vimg' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 28

Notice: Use of undefined constant vname - assumed 'vname' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 28
 

    *
      Issue
          o

            28th January 2009
            Picture of John Edwards

            Notice: Use of undefined constant vname - assumed 'vname' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 40

            by John Edwards

            Notice: Use of undefined constant vexcerpt - assumed 'vexcerpt' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 41

            On Wednesday 28 January, at The Sydney Institute  2009, Mark Johnson, former Chairman

            of Macquarie Bank, Dr John Edwards, Chief Economist with HSBC and Dr Timo Henckel, a

            Research Fellow with the Centre for Applied Macroeconomic Analysis at the ANU addressed a

            special forum on the global financial crisis. This seminar marked the first of a series of talks on

            the world financial downturn to be held at the Institute in 2009.

            Notice: Use of undefined constant vid - assumed 'vid' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 42

            Read more...


Notice: Use of undefined constant vimg - assumed 'vimg' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 28

Notice: Use of undefined constant vname - assumed 'vname' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 28
 

    *
      Issue
          o

            28th January 2009
            Picture of Mark Johnson

            Notice: Use of undefined constant vname - assumed 'vname' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 40

            by Mark Johnson

            Notice: Use of undefined constant vexcerpt - assumed 'vexcerpt' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 41

            On Wednesday 28 January, at The Sydney Institute  2009, Mark Johnson, former Chairman of Macquarie Bank, Dr John Edwards, Chief Economist with HSBC and Dr Timo Henckel, a Research Fellow with the Centre for Applied Macroeconomic Analysis at the ANU addressed a special forum on the global financial crisis. This seminar marked the first of a series of talks on the world financial downturn to be held at the Institute in 2009.

            Notice: Use of undefined constant vid - assumed 'vid' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 42

            Read more...


Notice: Use of undefined constant vimg - assumed 'vimg' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 28

Notice: Use of undefined constant vname - assumed 'vname' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 28
 

    *
      Issue
          o

            28th January 2009
            Picture of Dr Timo Henckel

            Notice: Use of undefined constant vname - assumed 'vname' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 40

            by Dr Timo Henckel

            Notice: Use of undefined constant vexcerpt - assumed 'vexcerpt' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 41

            On Wednesday 28 January, at The Sydney Institute  2009, Mark Johnson, former Chairman

            of Macquarie Bank, Dr John Edwards, Chief Economist with HSBC and Dr Timo Henckel, a

            Research Fellow with the Centre for Applied Macroeconomic Analysis at the ANU addressed a

            special forum on the global financial crisis. This seminar marked the first of a series of talks on

            the world financial downturn to be held at the Institute in 2009.


            Notice: Use of undefined constant vid - assumed 'vid' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 42

            Read more...


Notice: Use of undefined constant vimg - assumed 'vimg' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 28

Notice: Use of undefined constant vname - assumed 'vname' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 28

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: images and text
« Reply #36 on: March 08, 2009, 05:42:44 PM »
I haven't come across this error before so am not to sure what's causing it are you defining constants in another file or something?

Offline viren.nathoo

  • PHP Workers
  • **
  • Posts: 21
  • Karma: +0/-0
Re: images and text
« Reply #37 on: March 08, 2009, 08:39:10 PM »
ok I got rid of the error. But now i cant see the text. I know it is there because when i go to "view source" I can see it there but it is not visible on the screen.

I guess that there is a problem with the CSS then.
« Last Edit: March 15, 2009, 05:45:04 PM by viren.nathoo »

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: images and text
« Reply #38 on: March 09, 2009, 03:06:50 AM »
on your artcle menui you have display set to none which will hide the text try removing it.

Code: [Select]
#article_menu  {
clear : both;
background-color : #2c4658;
padding : 15px 20px 15px 0;
position : relative;
display : none;
}

Offline viren.nathoo

  • PHP Workers
  • **
  • Posts: 21
  • Karma: +0/-0
Re: images and text
« Reply #39 on: March 14, 2009, 03:34:38 PM »
hi there.

i got an error in this section of the code

Code: [Select]
echo "<li class="article_link">\n";
echo" <div class="primary">";
echo" <a href=\"spmemContent.php?vid=".$id."\">";
echo" <p class="date">$date/p>"\n;
echo" <h2><a href=\"spmemContent.php?vid=".$id."\" title=\">$title</a></h2>";
echo" <p class="byline">$name</p>";

echo" </div>";
echo" <p class="abstract">$excerpt</p>";
echo" <p class="read_link"><a href=\"spmemContent.php?vid=".$id."\">Read the full article</a></p>";
echo" <div class="clearer"></div>";
echo" </li>";

I cant figure out what this error is.

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: images and text
« Reply #40 on: March 15, 2009, 06:07:34 AM »
what does the error say?

Offline viren.nathoo

  • PHP Workers
  • **
  • Posts: 21
  • Karma: +0/-0
Re: images and text
« Reply #41 on: March 15, 2009, 12:09:54 PM »
here is the error

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /clientdata/www/au/t/thesydneyinstitute.com.au/sponline.php on line 44

here is the source code

Code: [Select]
<?php
$pageTitle 
"The Sydney Papers Online";
$pageClass "pub";
include 
"includes/common.php";
include 
"includes/header9.php";
?>

<link href="/styles/stylesp.css" rel="stylesheet" type="text/css" />

<div id="link_to_login"><a href="../mm2/register.php"><img src="../images/imageSPonline.jpg"/></a></div>
   
    <?php


echo "\n <h2>The Sydney Papers <span class=\"title\">Online</span></h2>\n";

$vlist mysql_query("SELECT * FROM v ORDER BY vdate DESC");
if (
mysql_num_rows($vlist)>=1) {
echo " <dl class=\"spList\">\n";

while ($v mysql_fetch_array($vlist)) {



$vdate $v['vdate'];
$year substr($vdate04);
$month substr($vdate42);
$day substr($vdate62);
$date date('jS F Y'mktime(000$month$day$year));

$name $v['vname'];
$title$v['vtitle'];
$id= $v['vid'];
$excerpt $v['vexcerpt'];
$img $v['vimg'];


$image  = ($img !="") ? "<span class=\"vimg\"><img src=\"downloads/images/".$img."\" width=\"80\" height=\"110\" alt=\"Picture of ".$name."\" /></span>" "";




echo 
"&nbsp";

echo 
"<li class="article_link">\n";
echo" <div class="primary">";
echo" <a href=\"spmemContent.php?vid=".$id."\">";
echo" <p class="date">$date/p>"n;
echo" <h2><a href=\"spmemContent.php?vid=".$id."\" title=\">$title</a></h2>";
echo" <p class="byline">$name</p>";

echo" </div>";
echo" <p class="abstract">$excerpt</p>";
echo" <p class="read_link"><a href=\"spmemContent.php?vid=".$id."\">Read the full article</a></p>";
echo" <div class="clearer"></div>";
echo" </li>";

   }
   echo 
"</dl>\n";
} else {
   echo 
"<p>There are currently no papers listed in the database.</p>\n";
}


include 
"includes/footer.php";
?>