Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. I mean, I have the is populated.  I have it coming from the database, I am sure I have it, I put the information for the cms into the cms table, with the userid, of the person who is constructing the page.  Now I do a query to select that user by his username(they are unique), then retrieve that id, into the $id variable Now I need to get the contents of $id, to replace the contents of the $id variable in that dynamic page.
  2. I am wanting to permanently(almost always), build my own custom programs. But that will be awhile, before I got back. Some things, so far, i like using third party, that is a Project management system - active collab Forum - smf(simple machines) shopping cart(3rd party) I seem to end up using those when I am needing a systme. I needed to get organized, and I still do.  I have finally gotten a lot of my projects themselves organized, as far as url's I have my favorite's menu, which it wouldn't be bad later if I had a thing inside my project management system, so I could manage url's, that and a contact manager, I will either request them to build into activecollab or I will program it myself.  I am swearing to myself, after this, I am permanently custom building my own stuff, I was anyway there for a long time, but these 3 things seemed to catch my attention a lot more, and they save a lot of development time, the shopping cart, I would probably try to build myself when I find a client with a good budget, and a decent deadline. I was wondering about a code managment system, I am finally getting ready to start getting together a system of functions, like for file related function I was going to call it file.php I have all those ideas down, but how do I make it so I can have it somewhere.  I don't know, I am trying to get an idea, of how to organize everything.
  3. Ok I could really, really use some help here, I have already constructed my database totally.  It is already complete and ready to go, my tables are all prepared, the directory creation works, duplicating and moving the file seems to work, but there is something I need to do now, that I absolutely can't figure out. Ok. Now, First of all I have a template page, this is page is called template1.php, there is some other pages, but there all the same, just different names, here is the code. Template1.php [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Template 1</title> </head> <body> <div class="content"> <?php $select = "SELECT * FROM usercms WHERE id = '$id';"; $query = mysql_query($select); while ($row = mysql_fetch_array($query)) { echo "<h4>" . stripslashes($row['header']) . "</h4>"; echo "<p>" . stripslashes($row['text']) . "</p>"; } ?> </div> </body> </html>[/code] Now, I have an area of code, in the page that returns information from paypal, and does some database work.  In that script I create a directory, open the template page(that contains the above information), adn write it to antoher file and save it to that other directory that I created.  While leaving the original file untouched, everything is done, but I ahve to find a way to replace the id value int he select query on the template page, to be dynamically replaced with the user id on the other page, how do I do that. Here is the code i have to that is doing the directory and file handling. [code] <?php // VERY IMPORTANT, everything below is used for directory creation. $var = preg_replace('/[^\x09\x0A\x0D\x20-\x7F]/e', '"&#".ord($0).";"', $_SESSION['subdomain']); $dir = "userpages/$var"; mkdir("$dir", 0700); if (!mkdir) { $errorhandler .= "unable to create the directory. Please contact support or try again.<br />"; } $infile = fopen("$_SESSION[template]", "r") // as readonly while (!feof($infile)) { $buffer = fread($infile, filesize("$_SESSION[template]")); } fclose($infile); // here I can do all my changes to the buffer variable(which contains the file information) $outfile = fopen("index.php", "w") // open writeable fwrite($outfile, $buffer) fclose ($outfile); // VERY IMPORTANT, everything above here is used for directory creation. ?> [/code] So far everything seems to be in order.  I need to be able to do it in that section that says here I can do all my changes to the buffer variable, I just need to get that id to be replaced dynamically by the one coming from this script any advice?
  4. [code]<?php if (!mkdir("/userpages/{$_SESSION[subdomain]}")) { $errorhandler .= "There was a problem creating the sub-domain, please contact support asap.<br />"; } ?>[/code] For some reason it's not creating it. First I had permission denied error, then I made sure the directory I was point to, was 777, and the page I am doing it with was 777.  THe thing is, the sesison is working, it is suppose to go into /userpages/ and create the subdirectory test just to see it in action, but it's not working for some reason, any advice.
  5. activecollab That is all I need to say, after 8 hours of straight studying, and looking, see with all my projects I didn't have time, but I was going to program one. That had everything I needed it's in version 0.7, and they are about to go to version 1.0 it already has everything I need, and they are about to add any more, that was everything I will ever need to manage my projects.
  6. I might have to buidl my own, there is something I am looking for specifically.  THose are nowhere near anything I would need, right now I am looking for something I can install to my server.  If I can't find something I will have no choice but to build it myself this tiem, I was looking for something quick, phpprojekt or something I have been looking at, but I am not sure, it seems to be clsoe to what I need, but I have to keep looking, if anyone knows of something let me know.
  7. well for one if you know c++ or something, then in a few months I will pay you fairly to teach me that language, that could give you some freelance work.
  8. I was thinking of building this, but because of my project load, I am a little busy lately.  I decided I could probably find a third party program for this, that is a lot more advanced than anything I could build within a few months.  I had some ideas if I build a custom one, but I am trying to get one with really advanced functionality, possibly one that would have taken anywhere near 6 months to build.  I am building as an extension for my website, so something like a forum, pricing engine, cms system(3rd party), shopping system(3rd party).  Most of the time I try to do custom programming, but when it comes to this, I want something huge, well something big, but something opensource, and free.  Something I can install on my server, and configure the way I want, tehy have free open source forum's I have permanently chosen smf(simple machines), and for shopping carts, I don't know wether I am custom programming those or not.  So for now I decided for this system I want to get a third party open source system, does anyone know of a goodone. I need to be able to keep personal log's. I am wanting to be able to do a lot with this, keep track of current projects, finished projects, project information from it, and numerous other things. I am wanting to do a lot.  As well as being able to take my emails, and save log's of them into the system, but mostly just a basic project management system, and a personal manager built in or something, if basecamp was free, and I could put it on my server, that would be almost what I want, but I don't think it has to be that powerful. If I can't find something in a few weeks, I might start building one in my spare time, if I don't find something to fit my needs, but I am starting to understand the idea behind programming.  You build something custom when you need something custom, but most of the time I need a shopping cart system, one already has what I need, with the campus source website I built it had to be custom because of the nature of the websit.e  Let me know if anyone knows of a good project management system, with a personal management system built in, or something similar????
  9. Ok here is the process I have to follow IPN "Instant Payment Notification" comes back from paypal. It hits my ipn.php page. I ahve already tested it out, that works Now i need to (ALL of this I have to do on ipn.php which is where paypal is sending back the information from.) 1. Database there user information, using there email address, and hashed password. 2. Withdraw there information from the database after entry, using there email address and hashed password. (The purpose is so I can obtain the id number the db associated with the username. 3. Database the text they have typed out for there content in a cms table using the userid that was associated with them(for association purposes). 4. Create a directory using the person's chosen domain name. 4. Based on what template they have chosen(currently template1.php or template2.php), open that specific file, and save the contents of the file to a variable. 5. Examine the contents of that variable, and locate the area that is labeled <div class="content"> 6. Add the following information underneat that line of code within the variable information I have extracted from the file. [code]<?php $select = "SELECT * FROM cms WHERE userid = '$id';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { // Display the content they ahd in the database out within the page here } ?>[/code] 7. Take the new variable containing the alterations that were made(the data insertion), and save it to the directory I had chosen for them, using the name "index.php". 8. Close the mysql connection, do garbage collection, and whatever else is needed(no telling how many requests might hit this page at one time). Now that is the process I have come up with, I have gotten help for a few pieces, like opening the file, resaving the file, copying it to another file, creating a directory, ex-cetera. There are a few things I am having trouble planning out before I start. I already set up the sub-domain script itself that he wanted, and it works, so that is taken care of, and the paypal, and ipn integration is already totally complete.  All I have to do now get the rest of what I listed finished.  I have been planning this a little at a time, and keeping him updated on the progress. Now I have to ask for one more bit of advice, and this is the last thread I will open, I will keep using this one for the rest of my questions on this project, since I got all the information together, and put down full details about what I was doing. Ok I need to figure out how to get the ID number of the user within the file information.  I have seen how to insert the information, if I just pass the id to it, will it automatically dynamically put it within the file, as needed or will that be a problem. Once I write out a portion of the code, or write everything out and start testing, this will be the same thread I use if I run into problems or something, so I don't keep opening threads, adn so the full explanation is right here.
  10. He probably got bored, after reading more than the 4th post.  Atleast I got helped in the process, thanks.
  11. I will keep this stuff in mind when writing my programs, thanks.
  12. ah ok, that will get me on the right track, thanks.
  13. Ok it look's like I was a little off.  I apologize.  Also thank you for the clarification, I thought that it was the other way around, thanks.
  14. I am working on something, it will end up dynamically creating a file near the end of the process, I need to take that file template1.php or template2.php whichever file I am duplicating, and I need to put it inside a folder, inside another folder. The folder that is holding my sub-domains is userpages which is one level deep so it's www.domain.com/userpages then in that directory, I am going to need to create a directory, where I can specific the name, and put the file I am duplicating within that directory, any direction would be appreciated.
  15. if ($line == "<div id=\"content\">"){ Won't that overwrite my <div id="content"> or will it start writing below that line, and knock everything below it down as it goes, or will it start overwriting things on that page, or just move them down some lines?? THen for the line <div id="content"> will it overwrite it, or start putting the content below it?
  16. alright sorry, shouldn't say things like that here http://talks.php.net/show/perf_tunning/ http://phplens.com/lens/php-book/optimizing-debugging-php.php http://www.dynamicwebpages.de/tutorial/50/ All of these deal with php performance. How to rewrite your scripts to be better optimized, how to make the quicker, and more efficient, without loosing functionality.
  17. it has to do with everything. Having a 6,000,000 page php will slow it down, then go back to school. No differnet in 6,000,000 than having 500 if you can optimize the page, rewrite the code, I already said it didn't entirely have to do with the length of the code, but also teh way it's written, as well as database interaction and other stuff. If you have 600 lines of code, and you rewrite it to be more efficient, and less lines of code, it's going to run faster, if this algorithm doesn't work for you, then get over it, you can't change the way php works.
  18. It is not the only thing that matters.  It also has to do with the "way" the code is written, what functions are used, database interaction, sessions, and a host of over things.  Including amount of xhtml, javascript, and css, and a few other factors.
  19. This partially makes since, but this is my first time doing this, can you explain the process a little.
  20. That's not true. I didn't say anything about rewriting that, I was not sure, as far as reducing code, it definitely increases performance.  Severely, when you are able to.  If you look at code that has for instance 800 lines of code. If you really try to optimize it for performance, then you could find a way to reduce it down to around 500, there is normally useless code put in there, or some unnecessary code, or duplicate code written 2 different ways but actually doing the same things. Sometimes you can just take a few lines of code, and rewrite it in a different manner to take less room. Yes it helps a lot, it also has to do with what pre-built functions are used, user functions(how tehre set up), number of database interactions, and a host of other things.  But code reduction is always one of the ways.
  21. Ok I have gotten everything together for this based off advice here and there. There is one element, I don't know how to do, or don't understand. i have a way to open the file, get the info, close the file. I have a way to take that information that was removed from that file, then I open/create a new file, and put that content within that file, set permissions on it, so the person can edit it with admin later, then close the file. I need to figure out how to place something within a file.  FOr instance. I have a file, it contains this. [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Template 1</title> </head> <body> <div id="content"> </div> </body> </html>[/code] currently that's all it contains.  Later I am going to have to actually put a atemplate on the page, so I will be doing that manually within the template page.  Now what I need to figure out how to do, is dynamically create cms information within the page.  I need to get the database call to display the information to show up there, I know how to extract the information from the file, and create another file and paste all that text in there.  I don't know how to "open up" the file and place contents in the file where I need to place it at. Chances are if it has something to do with finding a specific kilobyte position to start putting the information in, then that won't work, because when I go back and add in the styling for the page, and keyword preperation adn everything, it will change.  I can't ahve that happening?
  22. I know, that's what I was saying int eh post, I went over that specific thread 4-5 times, and I couldnt' figure out what you mean,t but it worked.
×
×
  • 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.