PixelatedKarma 65 Junior Poster in Training Featured Poster

Awesome thank you very much, but may I ask why you put: $mainmenu=""; in there?

PixelatedKarma 65 Junior Poster in Training Featured Poster

Hello everybody,
So this might seem like a really simple thing to some of you more advanced people but it has me extremely stumped, currently I am trying to create a menu.

What I have is a mySQL database with a row called page_name I have written the following code:

<?php
/**
 * This is the main menu
 */
$result = mysql_query( "SELECT page_name FROM ms_content" )
	or die(mysql_error()); 
$num_rows = mysql_num_rows($result);
while ($get_info = mysql_fetch_row($result)){
	echo ".:";
	foreach ($get_info as $mainmenu);
	echo "</br>";}


?>

On my template page I have

<?php echo $mainmenu ?>

Now part of this is working, see I have 8 columns of information in the page_name row which is repeating the ".:" 8 times....yay that works but the problem is is that it isn't showing up where I desire it to show up at and that only one page_name is appearing.

I am curious what I am doing wrong - what makes this tricky and maybe is confusing my young newbie mind is that the $mainmenu is being called on a separate page.

Thank you for the help!

PixelatedKarma 65 Junior Poster in Training Featured Poster

Thank you for your response,

I ended up just playing with my method until it worked. What I plan to do later is have a selection page that shows all the folders containing templates so for example you would have

Templates
\/
template1 / template 2 / template 3

When you go to this page it will show templates 1-3, by selecting one it will save to the template row in the database and that is the row that currently is being read to complete my require_once() string. If this makes sense.

PixelatedKarma 65 Junior Poster in Training Featured Poster

Hello everybody,

So this week I am coming up with two questions, they are probably silly questions but I have googled and come up with nothing.

1)Figured out number 1 by myself, accidently had a / where it wasn't supposed to be.

2)This one I have not tried to hard to do but I want to confirm that I am going about it in the right way. What I am trying to do is have mySQL call the directory in which to look for an index.php file.

So for starters what I was going to do is make a define() string that went something along the lines of

define([template],call from mySQL database)

then use

require_once(require_once("dir/themes/[template]/index.php");

My theory is that if you were to have the directory name setup in the mySQL database it would the define function would establish that [template] was the value in the mySQL database and would then insert that name within the require_once function.

Is my theory valid or am I completely out to lunch?


Thanks for the help guys and gals!

PixelatedKarma 65 Junior Poster in Training Featured Poster

No I got it all working - and I am going to stick with my complicated method, not because I'm stubborn but because now that I've got one part of code figured out now I want to keep building on it and building on it.

PixelatedKarma 65 Junior Poster in Training Featured Poster

Thank you both for the help, it makes alot more sense hearing it on here then reading it on a tutorial or in a book for some reason.

PixelatedKarma 65 Junior Poster in Training Featured Poster

That is the plan to get to that point eventually.

So then when is while() to be used?

Also according to what I have the body and html tags still do show up

PixelatedKarma 65 Junior Poster in Training Featured Poster

Yay it worked, now please excuse me cause my coffee has not kicked in yet this morning. But I'd like to ask you why yours worked, no since asking a question and getting an answer if you don't learn from it.

First you removed while which may have been redundant but my understanding behind using while is because it functions as a simple loop the loop itself (mysql fetching row info) would just cease to work, maybe I don't quite understand the purpose itself?

Am I correct in thinking that you exited the if and moved the include past the mysql_free_result($result); is because free_result is supposed to clear the value returned from the database?

Sorry if these all seem like rookie questions, I've worked on plenty of cms backends before that were powered by php but I'm trying to drastically improve upon my php coding (as its beginner at best).

PixelatedKarma 65 Junior Poster in Training Featured Poster

G'd evening,

So I built this script and figured that I had it all figured out, styled it with css only to find out something is messed up.

The php script is set so that it retrieves a value from a mySQL database and if it is 0 the site is offline if it is 1 it is online. When it is offline it displays a div with a logo with a set of text, when it is online it displays the site. This is accomplished using an if and else setup. The problem is the div with the logo and text that is supposed to display when the site is offline is now displaying over top of the site that is supposed to display when it is online.

Here is the code

<html>
<head>
<title>Title Here</title>
	<link rel="stylesheet" href="/offline/maintenance.css" type="text/css" />
</head>
<body>
<?php 
// Make a MySQL Connection
mysql_connect('localhost', 'dbuser', "dbpass") or die(mysql_error());
mysql_select_db('dbname') or die(mysql_error());

// Retrieve all the data from the "example" table
$result = mysql_query('SELECT * FROM sitesettings')
or die(mysql_error());  
while($row = mysql_fetch_object($result)) {
    if ($row->site_on_off=='0')
	echo '<div id="maintenance">
		<img src="offline/logo.png" title="Logo" alt="Logo" />
		<br>
		<h5>
			To bring our clients the best possible service from time to time we will pull our website down for maintenance and upgrades.
			Thank you for your patience. 
			<br><br>
			If this is urgent please contact us at ***-***-**** or by email.
		</h5>
		</div>
		';
else
	include("subdirectory/index.php"); 
}
mysql_free_result($result);

?>
</body>
</html>

As you can see what my …

PixelatedKarma 65 Junior Poster in Training Featured Poster

Nevermind, I got the table thing figured out with phpmyadmin (sorry for the wasted post). For beginners to phpmyadmin, I assumed the top row was the various stuff I had defined in the table row, instead each field I needed was its own separate row. I used insert to add the values I needed until I build the script, now I just need to get my original script working.

Alright so I've gotten it working!

Hopefully I don't confuse anyone.........

I used mysql_fetch_object in my php code to fetch an if function for $row->setting=='my desired value to have the offline' I then echoed "this site is offline".

else

include("subdirectory holding my site").

Now I know somebody who knows the directory that the site sits on can just bypass this first index.php page however it gives it a nice little look with not an overly absorbent amount of code whenever I need to take my website down for maintenance.

PixelatedKarma 65 Junior Poster in Training Featured Poster

Good morning everyone,
I could be crazy but I am starting to work more on both my php skills and my mySQL skills, forgive me if I am asking the wrong question in the right forum or vice versa.

My objective
I am building a script so when I log into my backend of my website I can "turn on and off" my website, I was going to accomplish this by building a php script that compared a mySQL table value with either 1 or 0.

So basically:

If table value = 0 the website is offline
else if table value is anything else - include the site

The script

<html>
<body>
<?php 
// Make a MySQL Connection
mysql_connect('localhost', 'myusername', "mypassword") or die(mysql_error());
mysql_select_db('pixelat4_mydatabase') or die(mysql_error());

// Retrieve all the data from the "example" table
$result = mysql_query("SELECT * FROM onandoff")
or die(mysql_error());  

// store the record of the "example" table into $row
$row = mysql_fetch_array( $result );
// Print out the contents of the entry 

//**this will be where the value is returned from the mysql database**//

if ($row=='0')
	echo 'this will be offline';
else
	include("ms.pk/index.php"); 
?>
</body>
</html>

I am currently using phpmyadmin (have never really used it before), does anybody have some good tutorials that explain indepth how to build a table(yes I have been googling and reading lots but find some of the tutorials to be contradicting and the others don't really explain why I'm doing it).

PixelatedKarma 65 Junior Poster in Training Featured Poster

Hello!

So this might be really weird, but I'm having one of those mornings (the type of morning that no matter how hard you think nothing quite happens haha).

So anyways where you guys step in - I am working on a website for a gaming clan. I am making a PHPNuke theme and have done alright so far with one little hiccup that is driving me up the wall. In the theme I am building to the right of my right block there is a 1 pixel wide vertical white strip. Right now with my layout it looks like this:

Logo (800px wide - no white space on right)
Content w/ blocks* (800px wide - one pixel strip down right even though its aligned perfect on the left)
Copyright (800px wide - no white space on right)

I know daniweb doesn't like posting links so I'm going to do my best to explain it (since I don't want to copy and paste 600 lines of code). I have this deep rooted sneaking suspicion that it is the content's background spilling underneath the right block, but I can't seem to figure out how to fix it.

This has kind of been a blast from the past working with html tables again (I know I shivered too) and since I am no expert php guru so far its been nothing but headaches and lastly the reason Im dumping this onto you kind folks is …

PixelatedKarma 65 Junior Poster in Training Featured Poster

Genius - fixing the & for $s made it work - thank you kindly!

Ya the password and username are variable as they are being sent to the database for account creation.

PixelatedKarma 65 Junior Poster in Training Featured Poster

Hey guys and gals; I've been chipping away at some code today and tried to run my program I am getting the error:
Parse error: syntax error, unexpected '&' in........on line 68

$stmt = $dbh->prepare("SELECT username, password FROM client WHERE username = :username AND password = :password");
[B]
          &stmt->bindParam(':username', &username, PDO::PARAM_STR);[/B]
          &stmt->bindParam(':password', &password, PDO::PARAM_STR, 40);

The bolded part is line 68. I am pretty new to php and have done a bit of looking into it but only problem is I think my code is right but dont have the knowledge or experience to tell for sure. Any help would be greatly appreciated.

PixelatedKarma 65 Junior Poster in Training Featured Poster

First Status Update - June 9, 2010

Well let me get the first status update completed. In the last two weeks I finalized all my plans for pkPortal. I created diagrams of how users will flow between the master website and their own subsites; I have spent alot of time researching assigning user levels to individual users; one thing that I have not been able to find in all my books and good ole google is if there is a suggested amount of user groups. For my project I would like more then the standard 5-10 user groups; but I am not sure if this will impact database performance.

As for physical work that I have actually completed(which is actually alot considering how much I had going on during my day job and at home):

  • Login Forms
  • Master Site Template
  • Static Backend Pages

Login Forms - I have created a folder called modules and decided to build my login forms as seperate php files which I will include or call when and where neccessary.

Master Site Template - I have created my master site template - fairly clean and basic(this way if I need to make changes later on I wont have to rip a perfectly good template apart): where the layout is to sit I have left blank. I wish to somehow (havn't figured which way I'm going to go 100% yet with this) incorporate dynamically generated content into this specified area similar …

PixelatedKarma 65 Junior Poster in Training Featured Poster

Good Afternoon Everyone;

Let me first start by apologizing to the moderators in advance if this is in the wrong forum but it is php / mysql related and I cannot find a place suitable for this thread. A few weeks back I had a discussion on these forums about creating my own CMS system in php. It was suggested in that thread that I post my progress. To help keep Daniweb clean and clear of over abundant posts I'll keep my updates to this thread alone.

Now let me introduce myself; I am a hard working man from Canada - I have a family and a full time job. Since I was roughly 16-17 years old I have dabbled in web design(all self taught); creating webpages both spectacular and well not so spectacular. I am moddest so I'll tell you that I am alright at css and html; I have completed several programming courses on the basics of php, c++/c, and c#. Quite frankly every week I try and sit down at the computer and spend countless hours researching and playing in php as any good beginner should. Because I live in the country I am surrounded by tractors and cattle instead of libraries where I can easily look up answers to my problems. So with all of that said I would like to state my three purposes of this project:

1)To further my own knowledge of php and mySQL
2)To build a program that …

PixelatedKarma 65 Junior Poster in Training Featured Poster

No I want it to use repeat-x; and the reason I am doing it this way before anyone says differently is because it can save *alot* of bandwidth. For example instead of having one 1600 wide pixel background - I can make one 400 - repeat it and save 1-2 mbs of download from what my users need.

I finally found the issue last night at about 2am (hey I had a brain wave okay). Problem was I kept checking firebug on firefox (if any of you new(er) developers are not using firebug I would *reeally* recommend installing it on your development machine. I went into the css sheet and removed shorthand properties - this allowed me to see what the entire webpage was calling (stuff I had defined and stuff I had not). One of the divs which uses a background image; repeats; etc I had been lazy on and hadnt wrote a background-attachment; property. This automatically reverted to background-attachment:scroll;. So food for thought for everyone that reads this - ALWAYS ASSIGN PROPERTIES EVEN IF YOU DONT THINK YOU'LL NEED THEM.

PixelatedKarma 65 Junior Poster in Training Featured Poster

Well the reason its set is because of this: I have a background image and then I have a container with another background image - the container holds a gradient which is in .png format thus creating a fade effect.

I have done this a few times without any problems but for some reason this time its giving me issues.

PixelatedKarma 65 Junior Poster in Training Featured Poster

Maybe I am missing something but I have checked and double checked and even triple checked my code and I can't figure out why background-attachment:fixed; isn't working!

The css code is:

#background {
        height:100%;
	min-height:100%;
	width:100%;
	margin:0px; 
	padding:0px; 
	border:0px;
	background-image:url(../images/bg.png);
	background-repeat:repeat-x;
	background-attachment:fixed;
	background-position:top;
}

For whatever strange reason the bg.png still wants to scroll with the window....HELP ME PLEASSSEE

PixelatedKarma 65 Junior Poster in Training Featured Poster

Ya but I do have 100% height on the site now - and its working great (in both IE and firefox). As content is added or removed it will expand the window so it becomes scrollable but case and point a single three line article the template fills the whole viewport regardless of browser size; and it still looks great.

PixelatedKarma 65 Junior Poster in Training Featured Poster

Thank you very much

PixelatedKarma 65 Junior Poster in Training Featured Poster

That wouldnt be a bad idea - are there any forums you would recommend posting the report in? Or should I do it in this one?

PixelatedKarma 65 Junior Poster in Training Featured Poster

Thank you for the response Chris; I already have a plan drawn up on what I expect the first version to do and how it should act, etc. So far I know I am probably a year from having it even somewhat to the point where other people might even considering using it as a CMS. I am currently working on putting together the dashboard and thus far it looks really good-I guess time will tell if it winds up to be a success.

PixelatedKarma 65 Junior Poster in Training Featured Poster

Hello everyone;
Forgive me if I'm posting in the wrong forum. I have scoured the web playing with 20+ CMS systems all with great pros and horrible cons - nothing has completely worked for me. I have limited but some php experience and I want to take the next step. I want to attempt to build my very own CMS system; not modify someone elses; but simply build my own. I wish to use php and MySQL and am wondering if anybody on these forums has some advice; maybe some resources/tutorials that I could look at.

I know it wont be Joomla or Wordpress or compareable for quite awhile and I have went through quite a few resources and I am pretty confident that I can succeed in completing this task just want to talk to people who have had experience building their own CMS systems so I dont repeat similar mistakes. My biggest concerns are of course security and useability so any help would greatly be appreciated. Thank you.

PixelatedKarma 65 Junior Poster in Training Featured Poster

I use bluehost - its a big fee up front but its been a GREAT service with GREAT support.

PixelatedKarma 65 Junior Poster in Training Featured Poster

Hello everyone,
I am currently wondering if I am backing myself into a corner. I am currently building a layout that has a center column that spans 100% of the height of the viewable browser window; on top of that I have put in a div with absolute positioning as a top menu bar that is exactly 25px in height. This part works. Now it gets tricky and is starting to make my brain hurt;

The top bar is a transparent .png because of how it is sitting you can see the top 25px of the column underneath it(this would be fine except it clashes with the background image). Now the simple solution would just be to make that top menu bar a solid color and be done with it - but I'm way to stubborn to give in that easy. So I am wondering if it is possible to position the column down 25px so the two don't clash but still keep the column expanding all the way to the bottom of the page?

Here is the css - the #site is the column and the #topbar is obviously the top menu bar:

#topbar {
	height:25px;
	width:100%;
	margin:0px; 
	padding:0px; 
	border-bottom: #000000 1px solid;
	position:absolute;
	top:0px;
	left:0px;
	background-image:url(../images/topbg.png);
	background-repeat: repeat;
	background-attachment:fixed;
	background-position:top;
}

#site {
	height:100%;
	min-height:100%;
	width:70%;
	margin:0px; 
	padding:0px; 
	border-left: #000000 2px solid;
	border-right: #000000 2px solid;
	background-image:url(../images/sitebg.png);
	background-repeat: repeat;
	background-attachment:fixed;
	background-position:fixed;
	float:left;
}

Please let me know if you need the actual page code. …

PixelatedKarma 65 Junior Poster in Training Featured Poster

Hey guys I'm new to these forums and I was curious about what avenue to take.

I am currently playing with Joomla and so far it seems not bad as far as CMS goes for developing and maintaining content on one website. However I am looking for something a little more refined for multi-site options. Yes I know I could use JMS multisite but it still doesn't sound like everything I'm looking for interms of the following:

I am looking for a CMS where multiple websites can be developed; and each site has two levels of administration - a Super Administrator/God Administrator who can change global values/configs/add/change everything/etc. And then a regular administrator that can change their assigned website.

So for example: S. Admin can change website A, B, C but administrator for site B cannot change content / settings on A or C.

Also another prerequesite would be that it(the CMS) is fairly easy to mold and sculpt.

Right now I'm thinking Plone + the Lineage extension sounds pretty much what I'm looking for but I want to know what all my options are and if Plone is what it says it is (ie. if anybody else has bad experiences with it).

PixelatedKarma 65 Junior Poster in Training Featured Poster

Hi guys,
Brand new here - and I'm praying to god someone can help me out. My blood pressure is probably triple what it should be.

First off let me apologize to the admins as I know this dead horse has been beat to death a thousand times on these forums - I have faithfully follow probably half the solutions to no avail.

Second - on to the problem!

I am currently working on a template for a fairly propular CMS; so far I love the template - until about 3 in the afternoon yesterday. The entire site is laid out in divs; but due to how the CMS implements it's various components it adds in tables.

So the problem area is actually a div with a table inside it and a table inside that table and of course the last table not spanning vertically 100% in IE (works perfect in firefox). One of these tables could potentially be removed - however the issue is then the three little boxes that are supposed to show content would not show up. I have tried building those out of divs unfortunately the divs would go all wonky and instead of having three perfectly square boxes with content I ended up having one rectangle; 2 squares (and of course regardless of the browser divs didn't want to span to 100% height inside the one mandatory table).

So to maybe recap and make life alittle easier; table A …