Added PHP Code ruined CSS design elements
10-16-2007, 08:05 PM
|
Added PHP Code ruined CSS design elements
|
Posts: 384
Name: Jeni
Location: Wisconsin, USA
|
Hope I said that correctly in the title...
I've been working on a project practically non-stop. I get the first set of pages done and it's decided that a comment area would be nice for feedback. So, I get out my comment script, set up the database, begin to change ALL the hundreds of HTML pages to .php but as I've learned well, check the first page and script first...well, I was in for a huge shock --adding the php code took away design elements of my CSS layout...
Okay, easier to see than for me to keep babbling, right?
Here is a HTML page the way the site is intended to look:
http://sheboyganshenanigans.com/judges/index.html
Here's a page after the php is added:
http://sheboyganshenanigans.com/judg...ual/adkins.php
What did I do? At the top of the page I added:
Code:
<?php include './include.php'; ?>
Then, where the comment box is placed I added:
Code:
<h2>Leave a Case Comment</h2>
<p>
<?php echo $c5t_output; ?>
</p>
I tried changing the doc type out of desperation, but that didn't do a thing.
The comment script does have a CSS file of it's own. Anyone know what is going on here and how I can fix this please?? I WANT MY LIFE BACK AND MISS MY NIGHTLY VISITS HERE!!  Thanks...
|
|
|
|
10-16-2007, 08:33 PM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
|
It looks like the file you included started with it's own head section. Right below
Leave a Case Comment
I see a second doctype, head section, and @import of another css file. I'm guessing that all that code is located in include.php. You don't need it there. You just need the html you want to include.
Take that stuff out of the included file and your page should work fine.
|
|
|
|
10-16-2007, 08:52 PM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 384
Name: Jeni
Location: Wisconsin, USA
|
Ohhh...  ... hhhh Van gogh, I am so incredibly sorry, but I don't understand!
Do you mean the include.php file? That is:
Code:
<?php
define('C5T_ROOT', '/home/content/s/p/i/spiritspeaksup/html/judges/comments/');
include C5T_ROOT . 'comment.php';
?>
Quote:
|
I see a second doctype, head section, and @import of another css file.
|
Where are you seeing this, van gogh? (apologies for my ignorance, but I'm - obviously, eh? - - not too well-versed in php).
thank you so much for responding so quickly! I e-mailed support where I bought this script early this morning but still haven't heard back.
|
|
|
|
10-17-2007, 06:17 AM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 321
|
You must open include.php or comment.php (to see code) and find there is it inside some css definitions. Remove this definitions and than try to run your page.
Shivaji
__________________
Please login or register to view this content. Registration is FREE - uncommon free scripts
Please login or register to view this content. Registration is FREE - Städte, Sport, Party, Gourment, Apartments, Hotels
|
|
|
|
10-17-2007, 07:31 AM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 1,606
|
Quote:
Where are you seeing this, van gogh? (apologies for my ignorance, but I'm - obviously, eh? - - not too well-versed in php).
|
He is seeing it in the html output when he views the source in a browser.
|
|
|
|
10-17-2007, 08:25 AM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 384
Name: Jeni
Location: Wisconsin, USA
|
Oh, thank you so much but I'm just not seeing any of this in either include.php or comment.php. Here is the include.php code again:
Code:
<?php
// Settings
if (!defined('C5T_ROOT')) {
define('C5T_ROOT', './');
}
$c5t_detail_template = 'comment.tpl.html';
define('C5T_LOGIN_LEVEL', 0);
// Include
require C5T_ROOT . 'include/core.inc.php';
require 'comment.class.inc.php';
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
require_once 'HTML/QuickForm.php';
// Start output handling
$c5t_out = new c5t_output($c5t_detail_template);
// Start comment handling
$c5t_comment = new c5t_comment;
// Start form handler
$c5t_form_action = getenv('REQUEST_URI');
if (c5t_gpc_vars('c5t_ssi') or c5t_gpc_vars('c5t_ssi_redirect')) {
$c5t_form_action = $c5t['script_url'] . 'include.php';
}
$c5t_form = new HTML_QuickForm('form', 'POST', $c5t_form_action . '#c5t_form');
// Add redirect URL
if (c5t_gpc_vars('c5t_ssi') or c5t_gpc_vars('c5t_ssi_redirect')) {
$c5t_form->addElement('hidden', 'c5t_ssi_redirect');
if ($c5t_ssi_redirect = c5t_gpc_vars('c5t_ssi_redirect')) {
$c5t['alternative_template'] = 'standalone';
} else {
$c5t_ssi_redirect = getenv('REQUEST_URI');
}
$c5t_form->setDefaults(array('c5t_ssi_redirect' => $c5t_ssi_redirect));
}
// -----------------------------------------------------------------------------
// Get form configuration
require 'comment_form.inc.php';
// Validate form
$c5t_message = array();
if ($c5t['display_comment_form'] == 'Y') {
$c5t_show_form = 'yes';
if (c5t_gpc_vars('save')) {
if ($c5t_form->validate()) {
if ($c5t_comment->put()) {
$c5t_show_form = 'no';
}
if ($c5t_ssi_redirect = c5t_gpc_vars('c5t_ssi_redirect')) {
header('Location: ' . $c5t['server_protocol'] . $c5t['server_name'] . $c5t_ssi_redirect);
exit;
}
} else {
if (sizeof($c5t['_post']) > 0) {
$c5t['message'][] = $text['txt_fill_out_required'];
}
}
}
$c5t_out->assign('show_form', $c5t_show_form);
$c5t_form_renderer =& new HTML_QuickForm_Renderer_ArraySmarty($c5t_out->get_object, true);
$c5t_form->accept($c5t_form_renderer);
$c5t_out->assign('form', $c5t_form_renderer->toArray());
}
if ($c5t['display_comment_form'] != 'Y' and $c5t['display_turn_off_messages'] == 'Y') {
$c5t_message[]['message'] = $text['txt_comment_form_turned_off'];
$c5t_show_form = 'yes';
} else {
$c5t_show_form = 'no';
}
// -----------------------------------------------------------------------------
// Get comment data
if ($c5t['display_comments'] == 'Y') {
require 'commentlist.class.inc.php';
$c5t_list_setup = array('direction' => $c5t['frontend_order'],
'limit' => 0);
if ((int) $c5t['frontend_result_number'] >= 1) {
$c5t_list_setup['limit'] = (int) $c5t['frontend_result_number'];
// Pagination does not work with SSI
if (c5t_gpc_vars('c5t_ssi')) {
$c5t_list_setup['limit'] = 0;
}
$c5t_out->assign('display_pagination', true);
}
$c5t_comment_list = new c5t_comment_list(false, $c5t_list_setup);
if ($c5t_comment_data = $c5t_comment_list->get_list(c5t_comment::identifier())) {
$c5t_out->assign('comment_list', $c5t_comment_data);
}
$c5t_comment_list_values = $c5t_comment_list->values();
$c5t_out->assign($c5t_comment_list_values);
if ($c5t_comment_list_values['result_limit'] > 0){
$c5t_page = ceil(($c5t_comment_list_values['result_number'] + 1) / $c5t_comment_list_values['result_limit']);
} else {
$c5t_page = 1;
}
$c5t_form->setConstants(array('page' => $c5t_page));
// Pagination form
$c5t_next_page = new HTML_QuickForm('nextpage', 'POST', $c5t_form_action .'#c5t_comment');
$c5t_next_page->addElement('submit', 'next', $c5t['text']['txt_next_page']);
$c5t_next_page->addElement('hidden', 'page');
$c5t_next_page->setConstants(array('page' => $c5t_comment_list_values['next_page']));
$c5t_end_page = new HTML_QuickForm('endpage', 'POST', $c5t_form_action .'#c5t_comment');
$c5t_end_page->addElement('submit', 'end', $c5t['text']['txt_end']);
$c5t_end_page->addElement('hidden', 'page');
$c5t_end_page->setConstants(array('page' => $c5t_comment_list_values['result_pages']));
$c5t_start_page = new HTML_QuickForm('startpage', 'POST', $c5t_form_action .'#c5t_comment');
$c5t_start_page->addElement('submit', 'start', $c5t['text']['txt_start']);
$c5t_start_page->addElement('hidden', 'page');
$c5t_start_page->setConstants(array('page' => 1));
$c5t_previous_page = new HTML_QuickForm('previouspage', 'POST', $c5t_form_action .'#c5t_comment');
$c5t_previous_page->addElement('submit', 'previous', $c5t['text']['txt_previous_page']);
$c5t_previous_page->addElement('hidden', 'page');
$c5t_previous_page->setConstants(array('page' => $c5t_comment_list_values['previous_page']));
$c5t_next_page_renderer =& new HTML_QuickForm_Renderer_ArraySmarty($c5t_out->get_object, true);
$c5t_end_page_renderer =& new HTML_QuickForm_Renderer_ArraySmarty($c5t_out->get_object, true);
$c5t_start_page_renderer =& new HTML_QuickForm_Renderer_ArraySmarty($c5t_out->get_object, true);
$c5t_previous_page_renderer =& new HTML_QuickForm_Renderer_ArraySmarty($c5t_out->get_object, true);
$c5t_next_page->accept($c5t_next_page_renderer);
$c5t_end_page->accept($c5t_end_page_renderer);
$c5t_start_page->accept($c5t_start_page_renderer);
$c5t_previous_page->accept($c5t_previous_page_renderer);
// Assign array with form data
$c5t_out->assign('nextpage', $c5t_next_page_renderer->toArray());
$c5t_out->assign('endpage', $c5t_end_page_renderer->toArray());
$c5t_out->assign('startpage', $c5t_start_page_renderer->toArray());
$c5t_out->assign('previouspage', $c5t_previous_page_renderer->toArray());
}
if ($c5t['display_comments'] != 'Y' and $c5t['display_turn_off_messages'] == 'Y') {
$c5t_turned_off = array('comment_title' => $text['txt_comment_display_turned_off'],
'comment_author_name' => $text['txt_administrator'],
'comment_number' => 1,
'comment_date' => c5t_time::format_date(c5t_time::current_timestamp()),
'comment_time' => c5t_time::format_time(c5t_time::current_timestamp())
);
$c5t_out->assign('comment_list', array($c5t_turned_off));
}
// -----------------------------------------------------------------------------
// Get current page data
require_once 'identifier.class.inc.php';
$page_data = c5t_comment::select_identifier(c5t_comment::identifier());
$c5t_out->assign('page_data', $page_data);
// -----------------------------------------------------------------------------
// Output
$c5t_output = $c5t_out->finish(false);
//echo $c5t_output;
?>
And how are/can you view(ing) the source code? My browser won't let me do that when I'm viewing the .php web page.
Oh grief, please help me.  What am I missing?? Thanks...
|
|
|
|
10-17-2007, 04:30 PM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
|
Jeni I viewed the html source, not the php.I saw the code after the php engine did all its work.
Did you get things fixed? I just took a look at the page. It's not quite the same as the other (the text looks a little bigger), but it does look like you found the extra <head> info and removed it.
|
|
|
|
10-17-2007, 11:57 PM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 384
Name: Jeni
Location: Wisconsin, USA
|
Hi van gogh - yes, I found the problem. I had used this script on another site and had copied and pasted the files -- well, in the template files, within a file, layout.tpl, (this took HOURS of digging!  ) I found a link to the CSS file for the other web site! That's what was causing the page to render so screwy! Stupid thing, huh? Well, I learned quite a lesson.
But since you mentioned viewing the code, when I have a web page up in my browser, the view --> source doesn't work. Nothing happens.  Why is that??? When I do the same on the local forum, which is also php of course, I can view the source code just fine. That one has me flumoxed.
I did have some problems with the text yet, yes. I had to fool around with the two CSS files a bit, although it still looks a bit different on the index page, which is just HTML. Couldn't figure that out, but it's not so different that it's harming the site or anything. Thank goodness! Thanks again for taking a look though. I tried to come in here earlier to post that I found the problem, but I could find my thread and was in a hurry to get these pages set up online!
|
|
|
|
10-18-2007, 12:52 AM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
|
Glad you got it figured out Jeni. The good thing about digging into all those files and finding the problem is you tend not to do the same again and even if you do it's easier to figure out next time.
Pages should show when you View => Source. Some sites will try to block it with javascript I think, but you can get by that easily enough. I actually use an extension for Firefox called web developer toolbar. It's by far my favorite Firefox extension and I don't think I could live without it anymore.
There's a view source on the toolbar which I use, but as far as I know it's doing the same thing as View => Source from the menu.
Do you have an example of a site that doesn't let you view the source and are you using Internet Explorer? Is it the site in this thread that doesn't let you view the source?
|
|
|
|
10-18-2007, 05:01 AM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 321
|
Quote:
|
But since you mentioned viewing the code, when I have a web page up in my browser, the view --> source doesn't work.
|
I am got this many times in IE6 when I use PHP include function on the page. But after refresh in most situation I can see source.
Shivaji
__________________
Please login or register to view this content. Registration is FREE - uncommon free scripts
Please login or register to view this content. Registration is FREE - Städte, Sport, Party, Gourment, Apartments, Hotels
|
|
|
|
10-19-2007, 09:56 AM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 384
Name: Jeni
Location: Wisconsin, USA
|
hi van gogh- - thanks again for the reply! First, yes it's the pages above that won't allow me to view the source. It's just what shivaji said -- adding the PHP include function seemed to disable my ability to view the source. Don't get that, though...
Oh and I'm using IE 7.
Boy, that took some digging and it felt like a miracle when I finally found it -- then it turns out to be such a stupid, simple mistake to correct! Seems to often be the case, doesn't it. 
|
|
|
|
10-19-2007, 11:53 PM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
|
Strange about viewing the source. Are you still unable to view the php version or can you view the source now that you fixed the page?
I just checked in IE7 and I was able to view the source.
This is a bit of a stretch, but I wonder if the default program you use to the view the source (Notepad I assume) has issues with php depending on how you have the settings. I don't think there's any issue. I don't use Notepad anymore and I was able to open a php file in it as you'd expect. It's all I can think of for why you're not able to see view the source.
I've often found when you're driving yourself crazy trying to understand why something isn't working the answer is so obvious that you're overlooking it. At least that's the case with me. Let's see my php hasn't worked at times because I forget to give the file a .php extension. I've wondered why a link wouldn't work when I was offline.
When you're really stuck try looking at very obvious things.
|
|
|
|
10-21-2007, 08:47 AM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 384
Name: Jeni
Location: Wisconsin, USA
|
Nope, can't view the source! Isn't that odd? The HTML pages I can but the one's with the php include I can't. I always use "View --> Source" but when I do that on a page with the php include in it, just nothing happens.
I do use notepad, yes. Hm, never thought that it could be issues with notepad. I can view the source from the files on my computer alright, though, and I do use notepad to edit them and its fine. Just when I bring the pages up online I can't view the source - but you can with notepad? Wow. Then it would have to be something with my settings but where on earth does a person find settings for notepad?
Has anyone else ever had this problem? (Trying to open a php file that's online with notepad and not being able to do so?)
Say, since we're talking about odd things like this, the icon for my php files insists on showing as a Broderbund icon and I know it's a small thing, but I absolutely HATE that icon but I simply cannot find it in my settings for icons. I've changed many icons before and know the process, so I have PHP files set to open in a chosen icon, but that stupid Broderbund icon still somehow overrides my chosen one.  Sort of a little thing, but creating different icons for different file types helps me immensely...thanks.
|
|
|
|
10-21-2007, 06:45 PM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
|
Jeni I think I can help with that last part and it might be what's causing your problem viewing the source too.
The icon represents the program that's set as the default for opening that specific file. The easiest way to change it is to open 'My Computer' and navigate to a php file somewhere in your file system. Right click on the file and choose 'Properties' and on the General Tab you should see at the top it will say 'Opens With' and the associated program. Click the change button next to that and select the program you want to be the default.
I have a hunch if you change it to Notepad View => Source will work on php files.
|
|
|
|
10-22-2007, 07:26 AM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 321
|
Quote:
|
Nope, can't view the source! Isn't that odd? The HTML pages I can but the one's with the php include I can't. I always use "View --> Source" but when I do that on a page with the php include in it, just nothing happens.
|
Did you solve this problem. I can see your source.
Shivaji
__________________
Please login or register to view this content. Registration is FREE - uncommon free scripts
Please login or register to view this content. Registration is FREE - Städte, Sport, Party, Gourment, Apartments, Hotels
|
|
|
|
10-22-2007, 08:53 AM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 384
Name: Jeni
Location: Wisconsin, USA
|
Well, van gogh, shivaji...I do have it set to always open in notepad and when I click on a php file on my computer, it does open nicely in notepad (but that ugly icon is still showing).
But I still can't view the source when attempting to from the web.
I tried finding some settings or something for Broderbund to disable it from opening or associating with PHP but I can't find that type of setting anywhere in my Broderbund. I have a feeling you're onto something though, van gogh -- bet there is a connection with that Broderbund software.
|
|
|
|
10-22-2007, 03:21 PM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
|
That is strange if the file type is associated with Notepad already. I would keep looking in the Broderbund settings. Another place you can look is the Internet Options settings. You can get to them either through IE (Tools => Internet Options) or through Windows (Control Panel => Internet Options). On the Programs tab there's an option where you determine which program is used as an HTML editor. It's probably set for Notepad since you can view the source of HTML pages, but it's a place to look.
I do get feeling there's something in this for the reason you can't view source files. Do you only use IE? If you have other browsers (and you should) can you view the source in other browsers?
Last edited by vangogh; 10-22-2007 at 03:25 PM..
|
|
|
|
10-22-2007, 06:53 PM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 384
Name: Jeni
Location: Wisconsin, USA
|
I'll re-check the Internet options settings -- haven't perused those in quite some time and did restore my computer a couple months back. Maybe I forgot to change something in there. Can't hurt to look...thanks.
Yes, that Broderbund does seem to be a problem -- even if it isn't the problem in viewing, it's a pain with that ridiculous icon and I just can't get that changed for anything.
I do use IE for all my work and such, but I do keep FireFox and Netscape on my PC for checking web site rendering issues, so will see what happens in those, too...thanks again!
|
|
|
|
10-22-2007, 07:42 PM
|
Re: Added PHP Code ruined CSS design elements
|
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
|
Since you have Firefox try installing the Web Developer Toolbar. I'm curious to know if it works for letting you view the source, but I promise you'll find it useful for many things even if it doesn't.
|
|
|
|
|
« Reply to Added PHP Code ruined CSS design elements
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|