Page 1 of 1

Need help with news display

Posted: Sat Oct 21, 2006 5:03 pm
by outdoorxtreme1
When I look at my website on the net, my news data wont show on my template news block when using a user defined tag as the page content. It shows up on any other pages where I just use HTML in the page content. Any ideas why this is happening?

Re: Need help with news display

Posted: Sat Oct 21, 2006 10:15 pm
by Dr.CSS
More info please...
Ver.?
what is in the UDT and why not use Global Content Block?
Do you have a link to the page?

Re: Need help with news display

Posted: Mon Oct 23, 2006 1:46 pm
by outdoorxtreme1
Ver 1.0.2

My UDT is this:
{cms_module module="news" summarytemplate="title.tpl"}

I tried useing a Global Content Block and here is the Error I get:

string(59) "Smarty error: unable to read resource: "globalcontent:News""

The Global Content Block for my Calendar works though.

Re: Need help with news display

Posted: Tue Oct 24, 2006 1:04 pm
by outdoorxtreme1
Here is my template

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <__html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
      <title>Trumbull Canoe Trails Club</title>
      <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
      <meta name="description" content="We are located in N.E. Ohio in the Youngstown/Warren area. We are an easy flat water club.">
      <meta name="keywords" content="kayak, kayaking, kayaks, canoe, canoeing, canoes, Ohio, Pennsylvania, kayak trips, flat water, paddle, paddling, boat, trumbull county">
      <meta http-equiv="content-language" content="en">
      <meta name="robots" content="index, follow">
      <meta name="rating" content="general">
      <meta name="author" content="Dustin Beach">
      {stylesheet}
      <__script__ type="text/javascript" SRC="/uploads/File/new_window_max.js">
      </__script>
    </head>
    </__body>
      <table cellspacing="0" cellpadding="0" class="bg">
        <tr>
          <td>
            <table cellspacing="0" cellpadding="0" class="bg1">
              <tr>
                <td class="header" width="100%">

<!-- HEADER CONTENTS START -->

                  <center>
                    <img src="/uploads/images/TCT_Logo.jpg" width="774" height="144" alt="logo">
                  </center>

<!-- HEADER CONTENTS END -->

                </td>
              </tr>
              <tr>
                <td colspan="3" class="topnav">

<!-- NAVAGATION BAR -->

                  <div id="menu_horiz">
                  <div id="wrapper">
                  {cms_module module='menumanager' template='cssmenu.tpl'}
                  </div>
                  </div>

<!-- END NAVAGATION BAR -->

                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td>
            <table cellspacing="2" cellpadding="2">
              <tr>
                <td width="170" valign="top">

<!-- START LEFT BLOCKS -->

                  <br>
                  <table class="outline">
                    <tr>
                      <td>
                        <table cellspacing="0" cellpadding="2">
                          <tr>
                            <td class="blockTitle2">Upcoming Events
                            </td>
                          </tr>
                          <tr>
                            <td height="205" class="blockContent">{global_content name='CalendarUpcomingList'}
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <img src="/uploads/images/page_flip_l.gif" width="150" height="15" alt="left page flip">
                  <table class="outline">
                    <tr>
                      <td>
                        <table cellspacing="0" cellpadding="2">
                          <tr>
                            <td class="blockTitle2">Visitor Status
                            </td>
                          </tr>
                          <tr>
                            <td class="blockContent">
                              <table cellspacing="0">
                                <tr>
                                  <td id="left" height="60">{embed url=http://www.trumbullcanoetrails.org/counter/counter.php}{embed header=true}
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <img src="/uploads/images/page_flip_l.gif" width="150" height="15" alt="left page flip">

<!-- END LEFT BLOCKS -->

                </td>
                <td style="padding: 0px 5px 0px;">
                  <table cellspacing="0">
                    <tr>
                      <td>

<!-- CENTER BLOCK DISPLAY -->

                        <br>
                        <table class="outline">
                          <tr>
                            <td>
                              <table cellspacing="1" cellpadding="5" width="200">
                                <tr>
                                  <td class="blockTitle">{breadcrumbs}
                                  </td>
                                </tr>
                                <tr>
                                  <td height="465" valign="top">
                                    <br>
                                    {content}
                                    <br>
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                        <br>

<!-- END CENTER BLOCK DISPLAY -->

                      </td>
                    </tr>
                  </table>
                  <div id="content">
                  </div>
                </td>
                <td width="170" align="center" valign="top">

<!-- START RIGHT BLOCKS -->

                  <br>
                  <table class="outline">
                    <tr>
                      <td>
                        <table cellspacing="0" cellpadding="2">
                          <tr>
                            <td class="blockTitle2">News
                            </td>
                          </tr>
                          <tr>
                            <td height="205" class="blockContent" valign="top">{global_content name='News'}
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <img src="/uploads/images/page_flip_r.gif" width="150" height="15" alt="right page flip">
                  <table class="outline">
                    <tr>
                      <td>
                        <table cellspacing="0" cellpadding="2">
                          <tr>
                            <td class="blockTitle2">Join Today
                            </td>
                          </tr>
                          <tr>
                            <td class="blockContent">
                              <table cellspacing="0">
                                <tr>
                                  <td id="left" height="60" valign="top">
                                    <center>
                                      <br>
                                      <a href="http://www.trumbullcanoetrails.org/index.php?page=Membership">Become a TCT Member
                                      </a>(only $10/year!)
                                    </center>
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <img src="/uploads/images/page_flip_r.gif" width="150" height="15" alt="left page flip">
                  <br>
                  <br>
                  <img src="/uploads/images/kayak5.jpg" width="150" height="49" alt="kayaker">

<!-- END RIGHT BLOCKS -->

                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="30" valign="middle" align="center">
            <div style="text-align: center; padding-top: 2px; font-size: 10px">
            <b>Trumbull Canoe Trails Club
              <br>
              <a href="mailto:outdoorxtreme1@neohoutdoors.com">Webmaster - Dustin Beach
              </a>
            </b>
            </div>
          </td>
        </tr>
      </table>
    <__body>
  </__html>
I am using this UDT as the content for the page:

Code: Select all

echo '<table cellspacing="1">';
echo '<tr>';
echo '<td align="center" width="125">';
echo '<strong><font size="1">Date</font> </strong>';
echo '</td>';
echo '<td align="center" width="125">';
echo '<strong><font size="1">Trip Location</font> </strong>';
echo '</td>';
echo '<td align="center" width="25">';
echo '<strong><font size="1">State</font> </strong>';
echo '</td>';
echo '<td align="center" width="25">';
echo '<strong><font size="1">Miles</font> </strong>';
echo '</td>';
echo '<td align="center" width="64">';
echo '<strong><font size="1">View</font> </strong>';
echo '</td>';
echo '</tr>';
echo '</table>';
echo '<hr>';
echo '<table>';

$host = "localhost"; 
$user = "user"; 
$pass = "pass"; 
$dbname = "dbname";

$connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); 
mysql_select_db($dbname); 

$query = 'SELECT * FROM trip_log ORDER BY  startdate, enddate asc';
$result = mysql_query($query) or die ('<p>select died: ' . mysql_error());

mysql_close();

while ($row = mysql_fetch_array($result)) { 
$startdate = date("m/d/y",$row['startdate']); 
$enddate = date("m/d/y",$row['enddate']);

echo '<tr>';
echo '<td align="left" width="125">';
echo '<font size="1">';
echo $startdate; if ($enddate!= $startdate) echo ' to ',$enddate;
echo '</font>';
echo '</td>';
echo '<td align="left" width="125">';
echo '<font size="1">',$row['triplocation'],'</font>';
echo '</td>';
echo '<td align="center" width="25">';
echo '<font size="1">',$row['state'],'</font>';
echo '</td>';
echo '<td align="center" width="25">';
echo '<font size="1">';
if (!empty($row['miles'])) echo $row['miles'];
else echo ' ';
echo '</font>';
echo '</td>';
echo '<td align="center" width="64">';
echo '<font size="1">';
echo '<a href="/index.php?page=Report&trip=',$row['tripid'],'">Trip Report</a>';
echo '</font>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
The news block works ok on pages where I am not using UDT as the page content.
Any ideas why I am getting this error for my news block on my template when I try to used the UDT code above for the content of a page?

string(59) "Smarty error: unable to read resource: "globalcontent:News""

I hope this is enough information. Let me know if it is not.

Re: Need help with news display

Posted: Tue Oct 24, 2006 2:31 pm
by outdoorxtreme1
I found if I take this line of code out of my UDT that the news block will work but then database I am trying to select for data won't work.

Code: Select all

mysql_select_db($dbname); 


Any idea how to get around this?

Re: Need help with news display

Posted: Tue Oct 24, 2006 3:00 pm
by outdoorxtreme1
Everything works good if I put my table from my data database to the cms database. I don't want to do this though. Is there a way to access another database witout it messing up the rest of the cms database info for the rest of the template?