Jump to content

Newbie CMS Problem


gabriel_vzw

Recommended Posts

Hey all,

 

I am a novice php user who used a simple CMS for the layout of my site. The URL is www.fmmetrocog.org.

 

The content is built like:

<?php

extract($_GET);

print "<div id=\"content\">";

 

if (empty($content)){

    $content = "content/index/content.html";

  }

include("php_ssi/configure.php");

include("php_ssi/db.php");

include ($content);

 

Then each link is built like:

<a href="index.php?content=content/about/history/content.html">//places the html file in the div

 

I am integrating a previously existing mysql databse into my CMS but am running into a problem. I cannot place the rows which are being retrieved from the my sql, so it pulls up a blamk screen. What I need to do is find a way so I can place the existing data in my CMS.

 

The existing database info I am integrating is built:

include("php_ssi/configure.php");

include("php_ssi/db.php");

 

print "<div id=\"rightnav\">";

print "<h2> Announcements</h2>";

print "<p>";

$query = "select * from announcement WHERE end_date >= $todays_date LIMIT 1";

$result = mysql_query($query);

$num_rows = mysql_num_rows($result);

if ($num_rows != "0") {

include("shared/php/announcement/announce.php");

//announce.php inserted below

<?

include("php_ssi/configure.php");

include("php_ssi/db.php");

$todays_date = date("Ymd");

$announce_count = 0;

$switch_color = 0;

$query = "select * from announcement WHERE end_date >= $todays_date ORDER by date ASC;";

$result = mysql_query($query);

$num_rows = mysql_num_rows($result);

if ($num_rows != "0") {

while ($row = mysql_fetch_array($result)) {

 

$record_id = $row['record_id'];

$title = $row['title'];

 

$year = substr($date, 0, 4);

$month = substr($date, 4, 2);

$day = substr($date, 6, 2);

 

$date = $month."-".$day."-".$year;

 

 

$title = str_replace("&squot;", "'", $title);

stripslashes($title);

echo "

 

                $title   <a href='/announcements/index.php?display_record=$record_id' target='_blank'>[More...]<br/></a>

 

________________________<br />

              ";

$announce_count++;

 

}

}

 

?>

 

                   

//announce.php ends

} else if ($num_rows == "0"){

$announce_count=0;

}

print "</p>";

print "<h2> Surveys</h2>";

include("php_ssi/configure.php");

include("php_ssi/db.php");

include("shared/php/survey/survey.php");

print "</div>";

 

The only line I really need to worry about is the bolded:

$title   <a href='/announcements/index.php?display_record=$record_id' >[More...]<br/></a>

//this produces the specific announcement

 

I tried to make my CMS print it by using my method of <a href="index.php?content='/announcements/index.php?display_record=$record_id'> Which should place it in my index.php $content variable. However it is blank since I believe  ??? because it already contains the index.php?display_record=$record_id' snippet.

 

Any pointers on how to integrate the previous DB items into my $content would be awesome.  ;D

If you go to the URL and click on the announcement you can see the terrible result which is occurring!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.