Jump to content

JustinM01

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Everything posted by JustinM01

  1. Is there any reason that people can think as to why DOMDocument::saveHTML would remove the following: <![if !vml]> <img src="someimage.jpg" /> <![endif]> A little clarification... This HTML comment tag is used in my company's email newsletter code and is necessary to make Outlook 2007 behave properly. For whatever reason, saveHTML strips it out. I know that this doesn't conform to HTML standards and I'm guessing that that is why it is being stripped. BUT, from reading on the internet, saveHTML can produce junk html code anyways. Any help is appreciated.
  2. Hi all, I am trying to get CakePHP Paginator helper to output links as such: http://someurl/page/1 At the moment it outputs links like the following: http://someurl/posts/index/page:1 I have figured out how to change the controller and remove the action from the url. Unfortunately, I have yet to be able to figure out how to get CakePHP to output just the page number and not 'page:1'. Any help is greatly appreciated!
  3. Basically I would like to create something like what PHPFreaks and other sites have. When you post something here your can include a code snippet in a code block within your topic content. I was wondering how to do that as I would like to include such a feature in my blog. I want to create something like the following: some code If anyone know's of a site that already explains how to do this, than I would certainly take a link as help! Thanks in advance.
  4. I usually just extend Zend_Db_Table_Abstract. Like this: class SomeTable extends Zend_Db_Table_Abstract { protected $_name = 'table_in_your_db'; protected $_primary = 'column_name_of_your_primary_key'; } Its very simple. This allows me to use Zend_Db_Select very easily along with updates, inserts, and deletes. $tableObj = new SomeTable(); $select = $tableObj->select(); $select->where(array("$id = $someId", "time" => "UNIX_TIMESTAMP(time)")); $row = $tableObj->fetchRow($select); Sure, I could make an actual function on the table to do the above seamlessly, but I haven't yet. It works, and it works well. It really is up to you and what you're comfortable with. So, yes, I do make separate classes for each of my tables. It allows me to do the above and get fancy if I so choose.
  5. Its not supposed to close at the bottom.
  6. Zend_ACL is for controlling access only. Use Zend_Auth to store details once the user has been authorized. Like so: $session = new Zend_Session_Namespace('Zend_Auth'); /* Add a valid property to the session and set its value to true */ $session->valid = true; I believe Zend_Auth creates a default namespace called 'Zend_Auth'. You will have to verify that in the docs though. As long as you create the namespace like I've shown and pass the namespace name to the constructor, you will be able to access anything your try and store. Zend Framework is designed so that you really shouldn't be using Zend_Session or PHP's builtin session management. Just take a look at the Zend Framework Programmer's Reference. It should be able to answer most of your questions. EDIT: Zend_Session will need to be used for somethings, such as logging out.
  7. Those are actually background images on different elements. There is text there that says exactly what the images say. The text is just offset by about 10000 pixels. It is a form of image replacement and is meant to help people with screen readers. I don't know if that affects Google or not, but if you look at the page's source you will see what I mean.
  8. Ah, crap. OK, here it is: http://www.jmccauli.com/. Thanks and my bad.
  9. Just released my personal, home cooked web site. Please, check it out and tell me what you think. Any advice/comments are very much appreciated! Justin
  10. Hi all, First off, I want to say that I'm basically a newb when it comes to apache and linux. Having said, that I'm wondering how to profile apache using valgrind. Basically, this is what I'm trying now: valgrind --tool=callgrind --dump-instr=yes --trace-jump=yes -v /usr/local/apache2/bin/httpd -X I then use kcachegrind to view the .out file. Unforunately, the callgraph is just filled with things and when I look at the side bar I really don't see anything related to the MySQL stuff my site uses, i.e. connecting to, querying. if you follow this link: http://talks.php.net/show/oscon06/6 it'll show you what I was hoping to get. Maybe I'm not using kcachegrind right, but, I don't know. Any help would be appriciated.
  11. No offense here, but that wouldn't take more than five minutes. So, you have to ask yourself if that 5 minutes of boredom is worth it. While you're waiting for a fix here that website is exposing your underlying directory structure, what webserver you're using, and the name of the php file that's causing the problem. Hopefully you have the site disabled or otherwise not actually hooked up the web right now. BTW, if you're unwilling to do, I'm not sure why you would expect us to.
  12. Just a quick question here to those of you who are using linux as the os for your webserver. I basically new to linux as far as using it as an os for my webserver. Recently I've been trying to get Apache, PHP, and MySQL to the newest versions on my webserver. The problem is I'm using Plesk as a control panel, as far as I know I shouldn't try to upgrade apache because of the control panel and I have to be careful when upgrading PHP and MySQL. So, the question: Would it be better to just ditch any control panel software or what? As staying current with new release of the web software I mentioned above is important to me. Thanks for any help, Justin
  13. OK, first off, I'm not sure whether this belongs as a PHP topic, MySQL topic, or a Linux topic...but here goes... Say I have user data stored in a MySQL database that needs to be deleted after so many days. Is there a way to do it in PHP? If not how would I go about doing it? If there is a way in PHP, would it be better to check it for deletion when the user logs in ( I know I could do this btw ), or just delete everything that needs to be deleted during a period where the website/database is under a low load? Thanks for any help.
  14. OK, I have a PHP calendar function that displays all the posts for the current year (when the page loads). I have arrows that allow the user to change which year to display. I'm trying to use AJAX so the page wouldn't have to be reloaded. I have it setup like this: Calendar page -> Javascript js file -> PHP handling script The handling script creates a new calendar object and initializes it to the requested year. The problem is that the two objects are not referencing the same object, so a user can only decrease the calendar date to 2006 or increase it to 2008 because every time the original page loads the calendar initializes to 2007. I don't have a problem passing variables from the original page through javascript and to the handling php script, but I do in the reverse direction. I currently call the javascript function from an onClick event in a link. Is there something I'm not seeing, or will the way I'm currently doing it not work and is there another way I should look at? ??? Thanks.
  15. Thanks again everyone for the testing. To s0co: yes, I've been thinking about that actually, thanks for the input!
  16. Yeah, like I said its more for better programming style, though maybe someone with more programming knowledge than I could add something a little more informative. Basically (as far as I understand it), it helps keep the programmer from doing things with the code that could possibly cause errors. Like if you had a class variable that your code expected to be an array, but you set it to a string...well, if you send it to a function first you could possibly do some kind of error handling with it. If you just set the variable and than had a class method use it, you might run into problems. I don't know, really, as far as I see it, its really a matter of good programming style.
  17. I've been using "PHP5 and MySQL Bible" and the Zend PHP 5 Certification Study Guide. Basically what you want to do is this: class Something { private something_variable; public function getS() { return $this->something_variable; } public function putS($something) { $this->something_variable = $something; } It's not so much that it will make it better, its just better programming style as far as OOP is concerned.
  18. Looks good to me. The only thing I would say you should change are the members of your classes from public to private, and create methods to get and set them. It may seem like extra work, but that is how class members should be defined. If you make all the members in a class public, you might as well stick to procedural code. Interesting and cool way of teaching yourself OOP in PHP5 though.
  19. OK, I'm trying to make own homebrew blog. I have exactly one day of experience with AJAX, that day being yesterday. Anyways, I was able to get a simple AJAX commenting system going, but I have a problem with another portion of my site. Basically, I'm trying to make a content box that lists each month there were posts for a particular year. Like this: ------------------------ | Post by Month for 2007 | | <<< >>> | ------------------------ | January (1) | | February (2) | | April (4) | ------------------------- I started by making a calendar class in PHP. It initializes to the current date and outputs the months with posts for the current year, 2007. Those arrows near the top of the box are supposed to decrease and increase the year, respectively. The problem is, my AJAX script routes to a PHP script sending a variable containing the requested year change, but when I initiate a new object from the calendar object and send the data back, it doesn't work. Now, this is because the objects in each page are different, so what happens is you can go to 2006 and 2008, but no farther than that. It also doesn't let you go back to 2007. I thought about serializing the class and sending it through AJAX to my php script handler, but either you can't do it that way, or I can't figure out how to get it work. I thought about have a very simple MySQL table to store the variable, but that doesn't work, obviously, because every user on the site would be modifying the same variable. Is there some other way to do this that I haven't thought of? I'm not looking for code so much as I'm looking for an explanation of how to do it, I should be able to figure out the code on my own. Thanks for your time.
  20. Great, thanks for helping out, I really appreciate it.
  21. Thanks for taking the time to test it. I haven't run into that problem before, maybe it was your internet slowing down for a bit? If not, maybe someone else could see if the same thing happens to them?
  22. Hi all, I have a basic comment system on a website I'm making. I would appreciate it if some people could test it out a bit. There is nothing much to it, just commenting, no comment rating or comment replies. It uses Ajax+PHP system. Name field expects either a one word name, or firstname lastname, but no more than two words. Example: "foo", "bar", or "foo bar", but not "foo bar baz". Website field is not required, but expects a normal format like http://www.phpfreaks.com/. Comment field, try whatever here, hopefully it will catch most things. The script should update the comment div and than the amount of comments for the post particular post within a second. URL: http://www.plugbrainhere.com/demo/indextest.php Thanks to those with the time to test it out.
  23. Thanks for the replies. rcorlew - Well, I wanted something that I hardly ever see on the web, so I came up with a right aligned website. I'm planning on leaving like that, but thank you for the response anyways. AndyB - I had planned on look at the size of the different fonts. I realize they are not the easiest to read, and I will probably either increase their size, or find a new cursive font. Same goes for the grunge font. I hadn't planned on adding much color, but I think I always had a plan for at least some color, as just black and white can be a bit boring. Thanks for the comments.
×
×
  • 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.