Jump to content

Php & Mysql Cms


divinedesigns1
 Share

Recommended Posts

hello people, how ya doing :) Im stuck at a certain part of this cms, which is, how do i allow the client to place a side column menu for each page 0.o, so far i believe i have to create a row in mysql call columnlink or leftlink or sublink, and i was thinking about using this code to do that $sqlCommand = "SELECT id, linklabel FROM pages WHERE showing='1' ORDER BY id ASC";$query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error());$menuDisplay = '';while ($row = mysqli_fetch_array($query)) { $pid = $row["id"]; $linklabel = $row["linklabel"]; $menuDisplay .= '<style type="text/css"><!--a { padding:10px; line-height:25px;}a:link { color: #FFF; text-decoration: none; display:inline;}a:visited { text-decoration: none; color: #900;}a:hover { text-decoration: none; color: #ccc; text-transform: lowercase;}a:active { text-decoration: none; color: #fff;}--></style><a href="index.php?pid=' . $pid . '" style="border:none;">' . $linklabel . '</a>'; }mysqli_free_result($query); but how do i command it to place the side nagivation bar the page it suppose to be on?

Link to comment
Share on other sites

You need another MySQL table that associates columns with page names.
so i do that then change the $linklabel to linkcol or w.e the new row name on the table correct?
Link to comment
Share on other sites

id int11 auto increment primarypagetitle varchar255 linklable varchar255sublable varchar255pagebody longtextpageorder int11showing enum('0','1')keywords varchar255description varchar255createdate dateextra varchar255 this is wat it looks like for the mysql structure "minus the sublabel" which i added in

Link to comment
Share on other sites

alrite ill try that, one more question then that should be it,how can i make the index page different from the other page so that the index page doesnt have the left column like its shown here www.divinedesigns1.us "its a demo site for testing" and um sigh ill ask the other question when i remember

Link to comment
Share on other sites

If you have anything that PHP can use to indicate that you're on the index page, then you can just test for that and not print the HTML for the column on the index. How do you know what page you're on?

Link to comment
Share on other sites

i know its on the index page cause thats the only page the whole site runs on, and can you check this out www.divinedesigns1.us the stupid <p></p> tab keep showing and im not too sure how to remove it blaaaah

Link to comment
Share on other sites

and i know which page im on according to the pageid number, like on the product page it would say pid=1, etc

Link to comment
Share on other sites

Just use an if statement to only print something if you're not on the index page. Like this:
if($page != 'index') {echo "Column data";}

sorry about the long waiting, was sleeping, and ill try that but do you know how to get rid of the <p></p> tabs so it wouldnt show?
Link to comment
Share on other sites

You'll have to put that code that generates those <p> tabs inside the if() block. By the way, the condition I presented earlier shouldn't be used literally. The $page variable should be an indicator of the page that the user is currently on, and the literal string 'index' should be substituted by a value that indicates that the current page is the index.

Link to comment
Share on other sites

how do i go about doing that, to make the $page variable know that the user is on the index page? and where do you live?

Link to comment
Share on other sites

Question, cant i just make the cms to just edit the words, like i create the site and place the <?php echo $pagebody ?> where the content goes and have the edited page just edit that area without just having one page only? :sorry: if that makes any sense

Link to comment
Share on other sites

I just asked you earlier.

If you have anything that PHP can use to indicate that you're on the index page, then you can just test for that and not print the HTML for the column on the index. How do you know what page you're on?
I don't know how to find out what page you're on, you're the one that designed the system. I don't know how your whole system works. Inside the template file you just need to put the <p> tags inside the if() statement:
<?php if($page != 'index') { ?><p>Some content</p><?php } ?>

Link to comment
Share on other sites

I just asked you earlier. I don't know how to find out what page you're on, you're the one that designed the system. I don't know how your whole system works. Inside the template file you just need to put the <p> tags inside the if() statement:
<?php if($page != 'index') { ?><p>Some content</p><?php } ?>

alrite, thanks sorry about asking the same Question, just confused on this part blaaah thanks tho imma go write it and c if it works
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...