View Full Version : New PHP coding website. Want to join in?
fileserverdirect
06-15-2010, 03:09 AM
Hey guys,
If you've been around here for a while you probably know me. I have created several ideas for major PHP websites. I have lots of folders on my computer of started projects but never finished mainly because of loss of interest, amount of time needed, or difficulty. They all shared a common idea around a script, such as my recent "ImageTracker". I have decided that all I'm really doing is making scripts for other developers to use in their sites, I would not have to deal with the load of hosting such a huge database and whatnot.
So, I've decided to make a catch-all website for all my scripts. So far, the name is PHP Stockpile (I'm going to register that name later). If you have a better idea, just post it, the domain wasn't bought yet. The focus of the site is very high quality free PHP scripts for webmasters. Each download will have a setup script and whatnot. I am using PHP Fusion as the CMS and I'm setting it up as I type, (well it's uploading).
I am asking any Dynamic Drive members if they would want to contribute to the site, not just in code snippets but in overall moderation of the site and co-admins. ALL OF THE TIME I see people ask common PHP questions here and fourm members promptly reply with a great answer, for example a script could be called "AutoConnect" All a user would do is include this file and All database connections are made. This is just a tiny example and I hope Dynamic Drive adopts this and constantly adds code to it.
EDIT: The CMS did not turn out as well as I planned, check it out here: http://phpstockpile.onionhouseonline.com/downloads.php
Thanks,
Ben
fileserverdirect
Comments, Questions, Reactions:
djr33
06-15-2010, 05:50 AM
While I don't think this is a bad idea, it already exists: pear, for example, and also websites like http://www.phpclasses.org/
On the other hand, creating some very general scripts for users here and then adding a PHP section to this site might be very useful. An obvious one is a form mailer script. But I know from ddadmin that this would need some strong motivation to move forward-- so some good, cross-server-compatible scripts would be a nice start.
I'd be willing to contribute some scripts I've developed if we got a php section going on DD. Some form mailers and xml-based comment systems, for example.
james438
06-15-2010, 04:32 PM
I like the idea of a friends of DD scripts site. I am sure that would be a lot of work to get it successful though.
djr33
06-15-2010, 08:05 PM
Also, the main problem with PHP is that it isn't any more standardized than Javascript, but this is just rarely an issue because developers are usually working with only one server. If we want to release scripts publicly, it will take testing across various environments and we'll need to account for PHP 4, 5 and 6, Windows and Linux, safe mode and not, magic quotes, etc.
fileserverdirect
06-15-2010, 10:47 PM
I have good feelings about this, however the CMS, PHP Fusion isn't exactly the best CMS for this type. I'm avoiding PHP Nuke for its security problems, however maybe we just colab and make a quick site. I don't know as going as far making a whole php section here, but I would like an affiliation.
To djr's first post: All of these massive script sites contain 1000's of scripts that do the same thing. This website (which I'll probably rename) is supposed to be a webmaster database of easy to use helpful php scripts. I was even thinking of hosting these scripts and webmasters could "include" these scripts. A wizard should be included with every download\ snippet such as a mailer snippet where the user enters the "to" "message" "cc" and attachments in textboxs, then they press "generate" and a code snippet with detailed instructions for installation. Other tools could include an array generator MySQL connection or my new idea "EasyMySQL" where common submitting functions are simplified in to easy functions like insertMYSQL($value, $column) to preset tables and connections for easy use.
----
Available names (all .com):
The Php Webmaster
PHP Partner
PHP League
PHP Curve (<= I like that)
----
Im using http://suggest.name/ (a great naming website...)
djr33
06-15-2010, 11:04 PM
sharedphp . com/org or sharephp . org are also available... a bit more generic, but very clear.
fileserverdirect
06-15-2010, 11:13 PM
sharedphp (dot com) I like that name. I will look into purchasing that after I have the site done.
Do you have any ideas on where to start coding. Obviously a CMS now would not work for all this, it's too specific. We'll have to code this from the ground up, however I'm not amazing at planning ahead the whole database structure and everything, so is there some basic CMS service you could recommend that already has tables set up? Or should we just start from a blank slate?
djr33
06-15-2010, 11:22 PM
It's not very hard to use a CMS if you just want to display code. But if you want it to run also, I agree.
If you've got enough time to devote, building a custom system wouldn't be that hard, I don't think. It's just a list and some dynamic pages for viewing scripts, right?
I'm pretty busy, and I will probably passively participate, but not too much more than that. Just FYI.
Also, if you type the domain names directly here, domain catchers may grab them before you can, so I put the extra spaces above on purpose.
Are you planning on:
1) offering scripts for download
2) allowing users to contribute scripts
3) hosting working demos of the scripts
4) allowing people to try their own code (like a "try-it" editor)
the further down the list, the more complicated, and the more customized your cms will need to be.
As far as cross-system compatibility, I think you should specifically disallow (or discourage) php4 scripts. Too much stuff is depreciated/removed, and there's not much offered that couldn't be done far better in version 5.
Beyond that, as long as you list server/version/library/extension/whatever requirements, it should all be good. You could write a script to check and compensate for magic quotes that could be included in other scripts. Instructions for disabling safe mode/magic quotes could be featured as well.
I'd be interested in contributing stuff, helping out where I could, but I probably couldn't make a larger commitment.
fileserverdirect
06-16-2010, 03:17 AM
So I have started working on the basic design: http://sharedphp.onionhouseonline.com/ (I used a DD Template ;))
Traq: There will be two main sections such as helpful snippets that include wizzards\ genrators\tutorials on simple accessible code. The other section will include downloadable and easy to set up scripts (each with an "install.php"). These scripts could include scripts like "FastEdit" (see php section) a fully fledged mailer, login system, MySQL classes, etc...
I don't know about hosting examples, and I asked awhile ago (2 years I believe) about A PHP Tryit, and it was too hard for security reasons. The only way scripts can be contributed is if they are selected to be contributors such as djr33, you and some other top PHP knowing members if they wanted to be.
---
Also any idea on how to setup the database?
I know I will need three table: users, snippets, scripts.
Users can be broken into id | username | password
Snippets and scripts: id |title | description
When a user calls say snippet.php?id=000001
The page will go to a "behind-public-access" folder containing all php pages for scripts and displays it. An alternative is to put all of the page in the database, but my current host only supports 50 MB MySQL storage, so I don't know if I want to risk it.
In a listing, the script will go to the database and just display the title with a short description.
BTW the users is just so you can login and upload the script.
----------------
After looking over my idea, it doesn't seem very practical, any other ideas?
djr33
06-16-2010, 03:32 AM
Take a look at pear:
http://pear.php.net/
I have some major problems with parts of the site, but it certainly is complex enough to be an example for what you're trying to do.
Figure out what features you need, and which you don't (there's a lot of extra stuff there, I think).
fileserverdirect
06-16-2010, 08:29 PM
At first I thought that I needed to use something from pear in my script, but I soon realized you meant the layout. Categories! That's what I'll need. I will use cid for category id. One thing I noticed was the urls: pear.php.net/package/Calendar/download, they are organized very nicely, I know you have a tutorial about how to do it but it looks complicated. Anyway, the desgin is pretty much done (It's blue): http://sharedphp.onionhouseonline.com/
I still haven't decided what the sidebar will do. The main navigation is at the top. Maybe the side navigation could be information about the script you are looking at such as download\ wizzard\ description\ comments... and use javascript to display information.
Just about to start the php coding, I think that the index page is going to be the only page and all others are inserted into it (like a template). But before that, is there any other desgin element that needs to be changed?
Also, I was thinking about changing the name AGAIN. How about functionalphp (dot) com. It has a double meaning.
djr33
06-16-2010, 10:13 PM
Pretty urls are 1. not required yet, 2. no harder to setup later (if using get variables now), and 3. not that hard to setup using that tutorial I wrote. My tutorial is very long but once you understand it takes about 2 minutes to setup-- I should rewrite it so it's more clear. The majority of it is my rambling/ranting while I tried to get it to work and tested against various possibilities-- now I'm using it on my sites and it's very stable. Perhaps I should simplify that now (I could simply write a "how to" at the top and leave the remainder as a "why" below). Also, that would be a great addition to the site. It's really much easier than using .htaccess by itself (unless you're good friends with regular expressions :p).
fileserverdirect
06-16-2010, 11:10 PM
Ok, tell me when you've updated it. And what do you think of functionalphp (dot) com? Any other ideas on the template design?
djr33
06-16-2010, 11:13 PM
For something like this with such a clear purpose, I'd prefer a direct name: shared php or something along those lines. functionalphp is fine, though, except that it's a little long.
And if you want to use the tutorial, just skip to the last post. That basically explains everything.
I also think sharedphp is the better choice. Have you thought about a forum (or) comment board for each script? I imagine it will be more successful with a community and interaction (especially community support for installing the scripts you host).
the layout looks fine, clean and professional.
djr33
06-17-2010, 01:10 AM
It depends on whether the idea is to expand DD to have PHP as well (and then this board would be the main 'forum'), in which case there could be comments on the scripts but not a real forum, or if this is going to be something independent. I'm not sure it really makes sense to have it be a help forum (in general) and script library, perhaps just the library.
For issues specific to the scripts (such as installing and bug reports) that might be useful, but perhaps in some limited way. Comments would get long, but maybe there is a way to work that out. However, starting with just the library and building up to that should be ok.
djr33
06-17-2010, 01:40 AM
I have summarized (in what I hope is a clear post) how to use my "pretty urls" method in PHP only.
The complex part is in the PHP and since you know PHP well enough, that shouldn't be a problem. I hope it's clear enough. Let me know if you have questions. It's a huge topic and there's a lot of background information to cover as well as many possibilities of what you can do with the script. But that's actually why I did this: I found lots of tutorials for .htaccess mod_rewrite, but they are were for very specific things, often things I didn't need/want to do. So this method allowed me to control it in PHP for anything I needed, so hopefully it'll be the same for you.
http://www.dynamicdrive.com/forums/showpost.php?p=229295&postcount=5
fileserverdirect
06-17-2010, 04:51 AM
I have a day off tomorrow from exams so I'll get right to work on it. I'll see what I can do with the pretty urls, shouldn't take too long to set up. I guess I'll keep it to sharedphp because it does seam simpler. As for a comment board, We'll see how it works out. The easiest form that I can think of is the CSS section of DD. Each script has a comment system underneath it. Still trying to figure out the database system. That reminds me, the CSS section on dynamic drive is almost exactly the kind of system. Each page has custom html and whatever. I think it's also using pretty urls, idk it's hard to tell.
Question: Would it be better to store the page entries in the MySQL database or as an HTML file in a directory that are included to the script page?
djr33
06-17-2010, 07:51 AM
Flat files are always easier but are harder to modify. If the only modifications will occur with experienced coders and not very often, then modifying flat files shouldn't be much of a problem. Keeping a corresponding key in the database might help, though, much like is usually done with storing images: keep the files somewhere, but track and organize in the database.
fileserverdirect
06-17-2010, 03:50 PM
I uploaded the .htaccess file. However it does not seam to work. If I goto anyother page then http://sharedphp.onionhouseonline.com/ it redirects to a 404 error. Here's the PHP I'm using:
if (!isset($_SERVER['PATH_INFO'])) { $_SERVER['PATH_INFO'] = ''; }
if (strpos($_SERVER['REQUEST_URI'],'/htdocs/index.php')===0) {
if (strpos($_SERVER['PATH_INFO'],'/index.php')!==0) {
$_SERVER['PATH_INFO'] = '/index.php'.$_SERVER['PATH_INFO'];
}
}
echo $_SERVER['PATH_INFO'];
and the .htaccess behind htdocs:
RewriteEngine On
RewriteBase /htdocs/
RewriteCond %{REQUEST_URI} !^/htdocs/index.php$
RewriteCond %{REQUEST_URI} !^/htdocs/index.php/
RewriteRule ^(.*)$ index.php/$1?%{QUERY_STRING} [L]
I am trying to get equivalent $_GET values after each / such as
sharedphp.onionhouseonline.com/snippet/easyMail
could become in php echo $var1.", ".$var2; would output snippet, easyMail. Is this possible?
EDIT: Just finished login system, however everything I do from here in needs $_GET commands, so I need to figure out this URL thing
and the .htaccess behind htdocs:
RewriteEngine On
RewriteBase /htdocs/
RewriteCond %{REQUEST_URI} !^/htdocs/index.php$
RewriteCond %{REQUEST_URI} !^/htdocs/index.php/
RewriteRule ^(.*)$ index.php/$1?%{QUERY_STRING} [L]
...
Two things: did you put your htaccess file "behind" htdocs/, or "in" htdocs/?
Second: you're writing /htdocs/, which points at a directory named htdocs in your site root. Is that correct, or is htdocs/ actually your root directory (as is the case with many web hosts)?
If htdocs is your root, do the following:
put the htaccess file in your root (e.g., htdocs/.htaccess)
rewrite the line in htaccess to read: RewriteBase /
fileserverdirect
06-17-2010, 08:27 PM
Currently, this is the file system:
/sharedphp.onionhouseonline.com/htdocs/.htaccess
This is my new .htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^index.php$
RewriteCond %{REQUEST_URI} !^index.php/
RewriteRule ^(.*)$ index.php/$1?%{QUERY_STRING} [L]
500 Internal Server Error <- Thats what happens
Also, when it does get woring, how can I change it into variables (see my previous post)
djr33
06-17-2010, 10:47 PM
traq is right. Now I believe you just are missing initial slashes on both of the rewrite conditions.
Currently, this is the file system:
/sharedphp.onionhouseonline.com/htdocs/.htaccess
This is my new .htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^index.php$
RewriteCond %{REQUEST_URI} !^index.php/
RewriteRule ^(.*)$ index.php/$1?%{QUERY_STRING} [L]
500 Internal Server Error <- Thats what happens
Also, when it does get woring, how can I change it into variables (see my previous post)
So, I should be able to access the site by going to sharedphp.onionhouseonline.com/htdocs (assuming everything was working correctly), right? Or would I go to sharedphp.onionhouseonline.com ?
I still suspect that the later is the case (just sharedphp.onionhouseonline.com)... If so, then djr is right that I'm right. If not, then djr is wrong that I'm right. Either way, I'm right because I haven't yet decided if I'm right or wrong :p
In any case, you need to sort this out before you can more on to getting the variables from the url. Once this works, that'll be easy.
djr33
06-18-2010, 12:58 AM
I still suspect that the later is the case (just sharedphp.onionhouseonline.com)... If so, then djr is right that I'm right. If not, then djr is wrong that I'm right. Either way, I'm right because I haven't yet decided if I'm right or wrong Ok, then I'll side with you. So I'm right too...
fileserverdirect
06-18-2010, 01:07 AM
Ok, I got it to work, but none of the images are showing up! I would assume this is because it's rewriting to the index. Is there a way you can make exceptions, or some other way to make this work? (Also now that it's [almost] working, I would really like to know how to pull those variables!)
djr33
06-18-2010, 01:26 AM
There are a few ways to handle this. I haven't yet figured out the best one. Here are some ideas:
1. The php page is now including the files, but if it includes an image file it isn't sending the right headers. So you need to serve the right header first, then you can include the file (or, actually, I think you're supposed to do readfile()... I think...).
2. Make an exception in the .htaccess file for an extension of .gif, .jpg, etc. I'm not quite sure how to do this, but it should be as simple as adding a rewrite cond !.gif, right? (Not sure on that format.)
3. As I posted earlier in the thread [about htaccess] you can do this a slightly different way: add rewrite conds for "if file doesn't exist", so that any real files do work. Just add those back in (see the rules with -d and -f, I think). But the problem here is that it no longer works to hide your files. For my purposes I wanted to use the directory for file storage and for including using PHP, but not to let people access them directly. So if that works for you, that'll be fine.
Perhaps the best way would be to combine these: make an exception for files that exist unless it's in a 'hidden' directory (make a list). I think this would be about rule ordering... haven't tried it yet though.
Or of course just use the "real" version of .htaccess mod rewrite...
fileserverdirect
06-18-2010, 01:30 AM
That did it! After a few google pages to what you said, adding this solved it:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Ok, So how do I get the variables?
djr33
06-18-2010, 01:54 AM
In the PHP, $_SERVER['PATH_INFO'] will contain the path. explode it with '/' and go from there.
taking the example in your post above:
Say the URL that was (silently) redirected to your index.php is sharedphp.onionhouseonline.com/snippet/easyMail. Here's the php that you might use:
<?php
$vars = explode('/', $_SERVER['REQUEST_URI']); // breaks apart the uri into an array
echo $vars[0].', '$vars[1]; // outputs " snippet, easyMail "
?>
whop, didn't see Daniel's post. His method is simpler, as it excludes any query string that may have been entered (you can then deal with it separately)
(if you were to use my suggestion, you'd have to explode() twice -first on the ? (if it existed) and then on the / -or your last exploded piece might include a ?query=somestring. So nevermind. :) )
djr33
06-18-2010, 08:02 AM
I played with it a lot. PATH_INFO and QUERY_STRING are the most useful of the $_SERVER array. Others might help also, but often REQUEST_URI is too bulky.
The easiest way to figure this out is to use print_r($_SERVER); on your page (AFTER setting up the mod_rewrite to php), then testing various possible URLs. That should reveal what will be the most helpful for you. Servers apparently vary on this as well, so do be sure that PATH_INFO exists, for example.
REQUEST_URI is in theory "simpler" in the sense that it's all in one and reliable, but it can cause problems because it will also contain any real subdirectories if this is setup in a non-root environment. For example if /test is real, but /test/var is not real, then REQUEST_URI will be /test/var and you need to first remove /test. And then there's the query string.
PATH_INFO is really nice because I think it exists only for this purpose, basically. It is (as far as I can tell) defined as the string FOLLOWING the file name, but BEFORE the query string:
/path/file.ext/test/1/2/3/?var=value
Using this method is the only way I could find that would allow both a query string and a fake path to be sent to the PHP page.
And this also frees up $_GET to be used as expected (based on the url the user types) rather than many methods of htaccess that instead just do something like /fake/path => file.php?url=/fake/path, and then loose any query string.
Sorry for rambling here... I feel like I'm distracting from the thread, but as I've said before, htaccess/mod_rewrite is really confusing... haha. But once it works, it's great.
no, the rambling is useful. :)
Cathy I
06-18-2010, 02:08 PM
I'm a newbie to this forum.
It's great to have a forum that focus on php because lots of people will benefit from it including me.
[link removed-- wait until 5 posts before using a signature, and in general avoid commercial links; ask a moderator if you have questions]
fileserverdirect
06-21-2010, 01:40 AM
http://sharedphp.onionhouseonline.com/snippet/function_creator
Thats just a quick test using the database system. I'm away from home so I cant really work much on this, but as soon as I'm home, I'll get back to work. Basically it works by "if" the first url line is "snippet" then search the database for the second url thing. And then from there I just pull data.
...are you using protection? :)
sql injection, i mean
fileserverdirect
06-21-2010, 07:35 PM
I am currently running the second url item (not really sure what to call it) through stripslahes() and mysql_real_escape() or somthing of that matter, As I said before. I am away from home and not looking at the code directly, but I pretty sure its along those lines. Is that enough? Should I be checking the first url thing before I run it through the if statement? I dont really think that is need though, right?
Beverleyh
06-22-2010, 08:16 AM
I only just saw this thread. I'd be happy to help contribute where I can around work and other projects so keep me posted.
ALso, thanks for offering to host Fast Edit earlier on in the thread but I'd prefer to host it on my own website and record download clicks from one place. Feel free to link to it once its up though if it fits into your ethos.
I am currently running the second url item (not really sure what to call it) through stripslahes() and mysql_real_escape() or somthing of that matter, As I said before. I am away from home and not looking at the code directly, but I pretty sure its along those lines. Is that enough?
It should be, though using both functions is a bit redundant. just mysql_real_escape_string() should be fine.
fileserverdirect
06-29-2010, 05:00 PM
I just finished a listing script of all snippets:
http://sharedphp.onionhouseonline.com/snippet
The actual snippets themselves aren't anything, they have no body, because, I am still working on the submitting script.
P.S I'll open up the admin system once it's fully functioning...
Comments?
fileserverdirect
07-02-2010, 01:34 AM
UPDATE: I need your guys help in testing the base submitting code. I opened up the admin section, username: demo, password: demo. Click add script. there is no body section because I havent figued out completly how to store php and then execute it without possibility of malicious code being executed. But aside from the body, it should work. But do not choose anything other than "snippet" in the dropdown box, it's not set up and will probabbly cause some errors. I am using an experimental "proccess id" system that I came up with for added security. Its very complex (kinda) but it checks a submitted id, with a url, with a database. I think its secure, I'll post it when I get to a computer. Also, for some reason I cant submit a script on some browsers (this mobile phone for instance) An if statement fails. The only thing that I can think of is that POST ids arent geting corectly passed. Thats where I need you. Test submitting random stuff in browsers and whatnot. If you get an error (a generated error by the script, that is) post it here.
-----
http://sharedphp.onionhouseonline.com/
user: demo
pass:demo
Click "Add Script"
Fill out random stuff
DONT CHOOSE "FULL SCRIPTS" IN THE DROPDOWN.
try with different settings in random browsers n OS's. Click on "Snippets" on the top to see a list of all snippts
your post should be there at the bottom
Also, it should be under 'functions' here: http://sharedphp.onionhouseonline.com/snippet/categories
-----
Thanks a million!
seems to be working. Fx3.6 & Chrome5.0 on Win XP media center.
about the script body: for the time being, why don't you simply store the code without executing it? Just use htmlentities() and store the scripts as .txt files. If you want to have working demos, you can set each one up manually, later (probably your best bet as far as security goes, too, you can review and approve each script before letting it loose on your server).
one (slightly unrelated) thing: when I put in my username, I press [tab] to go to the password field - but it goes to the login button first. Not critical, but it would be more user-friendly if you could tab from username to password to login.
fileserverdirect
07-02-2010, 01:44 PM
Yeah, about that login thing... when I was testing the database, I didn't add a password feild, it was a username and a submit. I just added the password after, I'll fix it when I get to a computer. --- The whole Idea of the "body" that has to do with php is the dynamic wizards, not the actual code itself. However javascript could sufice, I now realise., however more complex stuff should be done through php. And besides, I don't know alot of javascript, so....
I updated the login. I'm using tabindex to make it work.
fileserverdirect
07-05-2010, 02:26 AM
Ok, I just finished the body section however I want to add some custom bbcode phrasing in the form that I want to change [text="string123"] into <input type="text" name="string123"> I thought regex could help me so I went to http://txt2re.com/index-php.php3?s=[text="string"]&-20 and I could not figure out how to isolate between the quotes. I felt doing str...() would take forver to figure out, I wonder if anywould could point me in the right direction.
james438
07-05-2010, 03:11 AM
<?php
$text = '[text="string123"]';
$text=preg_replace('/\[text=\"(.*?)\"\]/','<input type="text" name="$1">',$text);
echo "$text";
?>
fileserverdirect
07-06-2010, 07:36 PM
Ok, almost done with the bbcode part, but I have ran aground on this one:
$text=preg_replace('/\[display=\"(.*?)\"\]/',$_POST['$1'],$text);
Is this possible?
james438
07-06-2010, 08:48 PM
I need to see an example of the string that is failing.
fileserverdirect
07-07-2010, 05:56 PM
Ok, I figured it out, preg_replace won't execute a replacement with php code unless the "e" modifier is in the pattern.
fileserverdirect
07-10-2010, 01:24 AM
Ok, I ran into another problem, I am trying to get newlines in code to work, when the code between the php tags was one line, it was fine. the snytaxHighlight fuction uses GeSHi and wraps a nice div around the code and adds newlines like snytaxHighlight("$var=value;\n if($this=='that')$thendothis='done';")
Quotes are REALLY screwing me up when it comes to code proccessing in preg_replace. Also I think my regex for php tags needs some love for newline capability (not sure how).
for this post I had to change the bbcode php tags to curly braces, in code they are brackets
$text = "
[text=\"string123\"]
[display=\"string123\"]
{php}
\\$var=\'value\';
function hello(){
echo \"hello\";
}
{/php}";
$text = htmlentities($text, ENT_NOQUOTES);
$text=preg_replace('/\[wizard\]/','<form method="post" action="">',$text);
$text=preg_replace('/\[\/wizard\]/','<input type="submit" value="Generate ->"></form>',$text);
$text=preg_replace('/\[text=\"(.*?)\"\]/','<input type="text" name="$1">',$text);
$text=preg_replace('!\[display=\"(.*?)\"\]!e',"''.returnPOST(\$1).''",$text);
$text=preg_replace('!\[php\](.*?)\[\/php\]!e',"''.syntaxHighlight(\"\$1\").''",$text);
echo "$text";
Can anyone point me in the right direction?
james438
07-10-2010, 03:19 AM
I have not looked at your script, but off hand you should escape characters that you want to be recognized as literals, such as []/\()'".?*^ I think that's pretty much all of them.
As far as newlines go add the s modifier.
What does the string look like after processing? That part I am not understanding.
fileserverdirect
07-10-2010, 04:49 AM
Where do I add the s modifier though If I want !\[php\](.*?)\[\/php\]!e to search for newlines in between the php tags, I'm also having a problem with php actually replacing a variable in the text. Which is why I originally used single quotes, but then everything got all messed up.
http://sharedphp.onionhouseonline.com/ <- theres a preview on every page
james438
07-10-2010, 05:32 AM
!\
(.*?)\[\/php\]!e
becomes:
!\
(.*?)\[\/php\]!es
I suspect that when you said you wanted to search for newlines you mean capture them with the (.*?). Correct me if I am wrong though.
Think of modifiers as a command to modify how PCRE operates all encapsulated in one letter. e means that you can now use php in your PCRE s means that you can use the dot (
.) to capture newlines, which before you could not do.
Just place modifiers between the ending delimiter, which in your case is the !, and the ending quote, so now it looks like:
$text=preg_replace('!\[php\](.*?)\[\/php\]!es',"''.syntaxHighlight(\"\$1\").''",$text);
you could add i like this:
$text=preg_replace('!\[php\](.*?)\[\/php\]!esi',"''.syntaxHighlight(\"\$1\").''",$text);
to make the regex case insensitive. The modifiers can be placed where I showed you above in any order, but they are case sensitive. Capital letter modifiers usually mean something different or nothing at all.
I would suggest that you use one type of delimiter for all of your PCRE just to avoid possible confusion if you need to make changes later.
I suspect that the quote problem is a separate issue from the PCRE. Here is what I saw on the page you posted a link to:
[php] \=\'value\'; function hello(){ echo "hello"; } I don't know if that is the string before processing, partly processed, or what you want the code to ultimately look like. I imagine you mean the second though. If you could post the before and after of the string I would have something better to work with.
I can see in your PCRE that you are using an embedded function. I don't know if functions are allowed in PCRE like that, but then again I have almost zero experience with functions. sorry :(.
Here is an example of using php in your PCRE with the e modifier so you can get an idea what the syntax looks like:
$text=preg_replace('/(<a.+>)(.+)(<\/a>)/Ue',"'$1'.str_replace('-','–','$2').'$3'",$text);
In this example the U modifier is also used. It reverses the greediness of the PCRE. Anyway, the regex you see here will replace all of the hyphens between the anchor tags with dashes while leaving the anchor tags themselves alone. In the PCRE above notice that the captured subpattern used in the str_replace part of the PCRE is wrapped in single quotes. That is important. I don't think the way you have your captured subpattern wrapped will work, but I have not tested you script out yet either.
Sorry for the length of this post, but I thought some explanation might be important.
I posted
[php] \=\'value\'; function hello(){ echo "hello"; } by changing the opening [ to &[, but if you edit your post on this forum your HTML code that you posted will revert to the symbols you will originally trying to convey here in your post/this forum, but at least you can now post what you were trying to originally :).
fileserverdirect
07-10-2010, 06:48 AM
Yep, it worked! You are really helping me understand regex, (which I know 0 about). And yes the function worked. $text is eventually going to be drawn from a database and will have had htmlentities() and mysql_real_escape_string() done to it before it's entered, so I simulated it below. However this causes a HUGE problem when outputting:
$text = '
[text="string123"]
{php}
$var=\'[display="string123"]\';
function hello(){
echo "\"hello\""; //should look like hello with quotes around it when outputed.
$sql="SELECT * FROM sqlcheck WHERE me=\'awsome\'";
}
{/php}';
$text = htmlentities($text, ENT_NOQUOTES);
$text = mysql_real_escape_string($text);
//$text submitted to database
//$text retreived from database
$text=preg_replace('!\[wizard\]!i','<form method="post" action="">',$text);
$text=preg_replace('!\[\/wizard\]!i','<input type="submit" value="Generate ->"></form>',$text);
$text=preg_replace('!\[text=\"(.*?)\"\]!i','<input type="text" name="$1">',$text);
$text=preg_replace('!\[display=\"(.*?)\"\]!ei',"''.returnPOST(\$1).''",$text);
$text=preg_replace('!\[php\](.*?)\[\/php\]!esi',"''.syntaxHighlight('$1').''",$text);
//$text = stripslashes($text);
echo "$text";
outputs:
\n
[text=\"string123\"]
\n
1.
\n$var=\'[display=\\"string123\\"]\';\nfunction hello(){\n echo \\"\\\\"hello\\\\"\\"; //should look like hello with quotes around it when outputed.\n $sql=\\"SELECT * FROM sqlcheck WHERE me=\'awsome\'\\";\n}\n
AHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!! *remind me to KILL magic quotes if I ever see him walking around.
When I enable stripslashes 2 lines from the bottom, this happens:
n
[text="string123"]
n
1.
n$var='[display=\"string123\"]';nfunction hello(){n echo \"\\"hello\\"\"; //should look like hello with quotes around it when outputed.n $sql=\"SELECT * FROM sqlcheck WHERE me='awsome'\";n}n
MAGIC QUOTES, OMG.
---
The php code should look like this:
$var=\'[display="string123"]\';
function hello(){
echo "\"hello\""; //should look like hello with quotes around it when outputed.
$sql="SELECT * FROM sqlcheck WHERE me=\'awsome\'";
}
How does vBulliten and like 1000 other websites keep all php code intact without risking vulnerability!!
Again curly braces were used in place of brackets for the php bbcode in $text
I tried your &[ but it didn't work, idk
djr33
07-10-2010, 01:53 PM
In general, htmlspecialchars() should be all that you need to remove any functionality from text. Unless you're then running it through eval() in some language, you'll be fine for displaying it on a page.
fileserverdirect
07-10-2010, 02:00 PM
But what about mysql injection?
james438
07-10-2010, 02:53 PM
what I meant to say in the last part of my last statement about displaying the square bracket is to convert it to &#91; from [. You can get the html code conversion from http://www.htmlconvert.net/ as well.
fileserverdirect
07-10-2010, 03:49 PM
That's the least of my problems, I really have no idea how to prevent the trillion of slashes and \n required for mysql entry
djr33
07-10-2010, 05:57 PM
What I meant above is for displaying the text. I suggest storing exactly what a user submits in the database, except escaping it first. Then you can output a .txt file for them to download or convert it to html when displaying it, rather than storing escaped PHP in the DB.
For mysql, just mysql_real_escape_string($_POST['data']) should be fine. Worry about the html after that.
fileserverdirect
07-11-2010, 05:32 AM
Ok, after 6 hours of cold hard debugging, I got everything to work, yeah, I. HATE. MAGIC. QUOTES. but anyway, I need some testers to make sure it's all working right (you). The only thing I have yet to do (as far as the script adding process) is check to see if the title is alphanumeric, and categories (which is already kind of done, it just needs a select menu).
-----
1. http://sharedphp.onionhouseonline.com/
2. username: demo
password: demo
-> Log In
3. Click "Add Script" link at the top.
4. Fill out everything. Use custom bbcode explained below:
-------------
bbcode example:
[size=4][b]crude[/b] example is a basis of what you[u]can[/u] do [color=red]functions[/color][/size].
Step 1:What would you like to output:[text="stufftoecho"]
[php]<?php
function outputText($text){
echo $text;
}
outputText("Hello World");
[/php]
Step 2: Then just copy the above code into your script and it should output "Hello World".
This example can be found phrased here: http://sharedphp.onionhouseonline.com/snippet/Output_text_through_a_function
And in a list here: http://sharedphp.onionhouseonline.com/snippet
------------------
Explanation of bbcode:
These classics are in: b,i,u,color,size.
New bbcode:
- creates a new form
[text="name"] - A nameable input text box. (future: default value will be added)
default value - Outputs the POST data for the requested name, if it is not found, then the default variable is used.
- Displays a submit button and ends the form (future: change the text on the submit button)
PLEASE use and test these new bbcodes when you try it out. Again an example is http://sharedphp.onionhouseonline.com/snippet/Output_text_through_a_function
PLEASE POST YOUR THOUGHTS\SUGGESTIONS\BUG REPORTS HERE!
Many thanks,
FSD
james438
07-11-2010, 01:07 PM
I would like to suggest making the textarea larger and there should be a way for demo to edit the scripts he submits.
Tentatively it looks like the program works rather well for submitting code snippets.
yeah, that's actually pretty impressive. I'd love to see the script.
I second the "editing" request. Or maybe a preview. I forgot to quote the value that's passed to my function :p
djr33
07-11-2010, 09:42 PM
FSD, I'm perhaps late on this, and I'm just reading bits since there's a lot to get through.
But regarding the problems with magic quotes, you can use a flag in your .htaccess file (in the root directory) to turn off this 'feature', even if you can't change the setting in php.ini. That may or may not simplify things for you.
I'm glad it's going well. On vacation, but keeping an eye on this. I'll have a handful of scripts to contribute at some point.
fileserverdirect
07-14-2010, 04:15 AM
Ok, I've been away for a while, but I was able to finish the editing script. I also made a new demo account to test it. demo2\demo2. To edit a script, Login, navigate to any script created by you, and click edit in the top right. Voila! Note that you can only edit scripts you made. Try making random ones with demo2 (also test out the bbcode!) and edit them.
http://sharedphp.onionhouseonline.com/snippet
fileserverdirect
07-15-2010, 09:56 PM
UPDATE: I was just about to start coding the "Full Scripts" section, is it really necessary or should everything just be a snippet?
ALSO: I may change the name (again) to something like snippetphp (a com of course) or sniphp like sniphp (the p is shared between snip and php) I am using alot of http://suggest.name/ (You really need to use this site!) and got: phpharbor, phploft, phpopolis, phpverse, phpbytesize (lol).
I like phploft myself.
I still like sharedphp. sniphp is kinda neat also.
As to "full scripts" vs. "snippets" - do you want full, all-encompassing, "complete solution" scripts? Or do you want to just stick with little, neat, bite-sized (no pun intended) scripts?
I think full scripts would attract and keep more users (but also more "help me, help me" users), whereas only snippets would attract fewer users (but more "developer"-mindset users).
djr33
07-16-2010, 02:03 AM
I think the scripts hosted should be exactly the same as the Javascript on dynamic drive. No "my first" scripts and only things that are actually useful. But some tools (snippets) and some full solutions (scripts) are both fine.
Personally I'd like to see lots of full scripts like a complete (basic) contact form mailer, but there are also lots of nice uses for snippets, especially functions. I've got a number that I use myself that I find very useful. I'd be happy to share them. And some things are not really expandable. For example, an image converter (to thumbnails) is commonly needed, but you can't really supply a "full script" since it requires so much configuration. So for that, just a function is good.
But also remember that we shouldn't overlap too much with php.net's function documentation. A lot of basic snippets are there and are very useful. What they lack are bigger things that put ideas together.
As for the name, I still like sharedphp. It's simple, it's very easy to remember, and I think that's the style of the intelligent programmer more than a more fun name. I mean that for general public sites a fun name is helpful, but no one will hold the slightly boring name against us, and its simplicity is a huge advantage.
"sharedphp" is what it says.
djr33
07-16-2010, 04:42 AM
Yeah, that's why I liked it. It's the sort of domain name that will get hits from people just guessing and typing that in.
fileserverdirect
07-16-2010, 05:49 AM
Ok, Ok, I get it, it's staying sharedphp :)
UPDATE: Full Scripts section now 100% operational (The first time I got a MAJOR code change to work on my first try ;)). I also made the login more friendly, It now redirects you to the page you were just on. I have Yet to decide what I am going to do with the homepage; I was thinking about making it the categories page, but like split down the middle, so Full Scripts on one side and Snippets on the other. Or it could be the most resent added with like a featured one. Maybe Even a blog, nah, I don't feel like coding a blog from scratch neither integrating one into my amazing one page 774 line index.php (I'm not counting geshi, the syntax highlighter). So what do you guys think?
djr33
07-16-2010, 05:56 AM
Haha, as long as you're ok with the name too.
I'm glad it's going well.
Remember one way to split up all that code is to just use some includes and separate files, if it gets to be too much to deal with.
Congrats!
fileserverdirect
07-16-2010, 06:11 AM
No, Im actually impressed that my entire site consists of one page, and it's not too much to deal with 'cause everything is indented, but even then, there is one segment of code where I have to scroll over to the right to see the start of it (even on my wide-screen monitor), but really what do you think I should do with the homepage?
EDIT: Just added a cool-i-o CSS3 glow around code block now: http://sharedphp.onionhouseonline.com/snippet/Completey_output_text_through_a_function Thoughts?
fileserverdirect
07-18-2010, 03:33 AM
YAY, Senior Coder! Anyways, after a full day of programming, external files can be added! The script makes a folder, turns it into a zip and allows you to link to it via url text. Try it! The only bug is that you can't overwrite the files in EDIT mode (still working it out).
fixed, lol forgot to add enctype="multipart/form-data" to my edit form! I spent like 3 hours debugging to realize that. Oh well, you can now edit all your zip files!
Also, I am going away for a week to camp (no internet NOOOOOOOOOOOO!) so I won't be able to work on this, so yeah, see you guys in a week!
fileserverdirect
07-26-2010, 03:59 PM
Ok, I'm back. Still, does anyone have any idea of what to do with the homepage?
you mean, style-wise? I think it looks fine. maybe have the blue menu column extend all the way down the page, but otherwise it looks nice and clean. It's for developers, it doesn't need to look trendy or anything.
djr33
07-26-2010, 08:41 PM
For content, I think a minimal approach is fine.
Clear navigation, a quick mission statement, and an easy to find search bar or whatever navigation will be used the most. Something like php.net, but without all of the annoying text that is mostly useless.
And at some point, some "newest scripts" or "updated scripts" would be good.
fileserverdirect
07-27-2010, 12:34 AM
Ok, I'm working on the search bar, but I ran into a problem, I need to search two tables for info. I don't really know how to do it as I have never needed it; but I did some googling, but the stuff I found doesn't work.I get an error why I try the below code.$search is the escaped query.
$sql = "SELECT * FROM snippet AS sn, script AS sc WHERE sn.title LIKE '%" . $search . "%' OR sn.description LIKE '%" . $search . "%' sc.title LIKE '%" . $search . "%' OR sc.description LIKE '%" . $search . "%'";
Any ideas?
djr33
07-27-2010, 12:57 AM
Isn't it just a missing "OR" before sc.title?
fileserverdirect
07-27-2010, 05:26 AM
Yeah, that's my fault, I was copying and pasting and forgot the preceding OR. But for some reason now whenever there is a match I get a blank page, when there isn't, the page loads fine with the custom generated error. Full Search script:
if (isset($_POST['submit'])) {
if (preg_match("/^[ a-zA-Z]+/", $_POST['search'])) {
$search = mysql_real_escape_string($_POST['search']);
$sql = "SELECT * FROM snippet AS sn, script AS sc WHERE sn.title LIKE '%" . $search . "%' OR sn.description LIKE '%" . $search . "%' OR sc.title LIKE '%" . $search . "%' OR sc.description LIKE '%" . $search . "%'";
$result = mysql_query($sql) or die("Error Searching");
$row = mysql_fetch_array($result);
$count = mysql_num_rows($result);
if($count>"0"){
while ($row) {
echo "<ul>\n";
echo "<li>" . "<a href=\"search.php?id=$ID\">" . $row['title'] . " " . $row['description'] . "</a></li>\n";
echo "</ul>";
}
} else {
echo genError("No results found");
}
echo "yp";
} else {
echo genError("Please enter a vaild search query");
}
} else {
echo genError("Please enter a search query");
}
The stuff inside the while loop is just filler and will be replaced, (it was there from the site I got it from)
fileserverdirect
07-28-2010, 03:13 AM
Ok, I fixed that bug, but now there's a weird one, try searching something say the word "zip". You would think, based on the query, that Zip Test would come up, but it doesn't. And sometimes there are duplicates, I don't understand. Here is the new fully reworked script:
if (isset($_POST['submit'])) {
if (preg_match("/^[ a-zA-Z]+/", $_POST['search'])) {
$search = mysql_real_escape_string($_POST['search']);
$sql = "SELECT * FROM snippet AS sn, script AS sc WHERE sn.title LIKE '%" . $search . "%' OR sn.description LIKE '%" . $search . "%' OR sc.title LIKE '%" . $search . "%' OR sc.description LIKE '%" . $search . "%'";
$result = mysql_query($sql) or die("Error Searching");
//$rows = mysql_fetch_array($result);
$count = mysql_num_rows($result);
if($count>"0"){
if($count>1) $plural="s";
genOk("Your Search for \"".$search."\" returned ".$count." result".$plural.".");
echo "<ui class=\"results\">";
while ($rows = mysql_fetch_array($result)) {
$rows['title_format'] = str_replace("_", " ", $rows['title']);
echo "<li>".$rows['title_format']."<br>".$rows['description']."</li>";
}
} else {
echo genError("No results found for \"".$search."\".");
}
} else {
echo genError("Please enter a vaild search query");
}
} else {
echo genError("Please enter a search query");
}
I don't see anything in particular, try out the search itself. http://sharedphp.onionhouseonline.com/ <- On the sidebar.
fileserverdirect
08-01-2010, 11:54 PM
Anyone?
james438
08-02-2010, 03:27 AM
try this:
$sql="
(select * from snippet where title LIKE '%$search%' OR description LIKE '%$search%')
UNION
(select * from script where title LIKE '%$search%' OR description LIKE '%$search%')";
Also you have three consecutive else statements. The first two should be elseif with a condition or combined, but it looks like they are just unnecessary.
fileserverdirect
08-02-2010, 04:47 PM
That solved the erratic search results, but I have run into a minor problem. There needs to be a link, however There is no way in telling if the returned result is in witch table, so I made this script:
while ($rows = mysql_fetch_array($result)) {
$sqla="select * from script where title='".$rows['title']."' OR description='".$rows['description']."'";
$resulta = mysql_query($sqla) or die("Error Selecting");
$counta = mysql_num_rows($resulta);
if($counta=="1") $type="script";
$sqlb="select * from snippet where title='".$rows['title']."' OR description='".$rows['description']."'";
$resultb = mysql_query($sqlb) or die("Error Selecting");
$countb = mysql_num_rows($resultb);
if($countb=="1") $type="snippet";
$rows['title_format'] = str_replace("_", " ", $rows['title']);
echo "<li><a href=\"/".$type."/".$rows["title"]."\">".$rows['title_format']."</a><br>".$rows['description']."</li>";
}
However BOTH if statements are validating, so every link is /snippet/whatever. I tried adding .="snippet" to see, and sure enough, /scriptsnippet/whatever was shown. I found that this only happens when there are results in multiple categories. If there are only results in one, then it works. I know the code is almost there, I just need a nudge in the right direction.
P.S. About to order domain, sharedphp it is...
james438
08-03-2010, 12:40 AM
This is actually not too hard to fix.
$sql="
(select title, title_format, description, 'snippet' AS tablename from snippet where title LIKE '%$search%' OR description LIKE '%$search%')
UNION
(select title, description, title_format, 'script' AS tablename from script where title LIKE '%$search%' OR description LIKE '%$search%')";
The only drawback is that you now must write out the names of the columns that you want to select as opposed to using *. You may be able to pull all of the tables using *, but I am not sure how to do that when you are adding a virtual column as well. tablename is a virtual column that does not exists in either of your tables, but is generated temporarily via MySQL and added to the data you retrieved from your database. Your actual tables have not been altered.
fileserverdirect
08-03-2010, 03:55 AM
Well, that seamed to do the trick, but I now realize why both if statements weren't failing, because I had identical titles in both script and snippet databases from when I copied the table structure and data! Anyways, this solved any future problems arising too.
DJCyrus81
08-03-2010, 08:35 AM
i want to join in
fileserverdirect
08-03-2010, 02:47 PM
Do you have any completed works in php, or anything that could prove your usefulness in sharedphp? The reason that I have let the others in is because I know they are great coders and will provide great content for the site, however you only have 8 posts, none of which prove anything, but that's just going on just DD forums. If you have anything else, please, do post it here.
james438
08-03-2010, 11:28 PM
what's next in the way of setting the site up?
fileserverdirect
08-04-2010, 12:27 AM
Well, come to think of it, I was looking over my code and It seams I had completely missed the category section implementation. I still only have 2 categories. Currently I use numbers in the database to sort categories, and I use a switch to translate them here:
function categoryId($id)
{
switch ($id) {
case 1:
$name = "Functions";
break;
case 2:
$name = "Mail";
break;
}
return $name;
}
I would assume that I would need a reverse switch function to turn a name into a cid number. ugh.
and this is the entire category display code, it is not very efficent at all:
<?php
//...
elseif ($cmd['1'] == "snippet" || $cmd['1'] == "script") {
$type = cleanSQL($cmd['1']);
$typeF = ucwords($type);
if ($cmd['2'] == "categories") {
?>
<div style="width:95%;">
<table cellpadding=3 cellspacing=0 style="width:100%; min-width: 400px;" id="categories">
<tr>
<td>
<h2>Mail</h2>
<ul>
<?php
$sql = "SELECT title FROM $type WHERE cid=2";
$result = mysql_query($sql);
while ($rows = mysql_fetch_array($result)) {
$rows['name'] = spaceIt($rows['title']);
echo "<li><a href=\"/$type/" . $rows['title'] . "\">" . $rows['name'] . "</a></li>";
}
?> </ul>
</td>
<td>
<h2>Functions</h2>
<ul>
<?php
$sql = "SELECT title FROM $type WHERE cid=1";
$result = mysql_query($sql);
while ($rows = mysql_fetch_array($result)) {
$rows['name'] = spaceIt($rows['title']);
echo "<li><a href=\"/$type/" . $rows['title'] . "\">" . $rows['name'] . "</a></li>";
}
?>
</ul>
</td>
<td>
<h2>Other</h2>
</td>
</tr>
</table>
</div>
<?php
}
//...
?>
It's very rudimentary and most likely can be simplified.
I still have no code to enter a cid value, up until now I have just manually entered 1 in as a placeholder.
----
Also another thing (maybe the last thing :)) is the homepage, and I am taking like a recent scripts\snippets and\or a featured script\snippet into consideration. Also:
...maybe have the blue menu column extend all the way down the page... Yeah, I tried for like an hour today and css is not my forte, Maybe I'll post an actual question in the css section later on.
Yikes! I just realized that I still have a static title, just "sharedPHP" and all of my content code is well, after the head section so I cant set the title. However I just had an idea. I could use JavaScript to dynamically set the title after the content is processed. In such that I would place a php variable, say $title into a javascript code like document.title="<?=$title?>" Not really sure how to completely do that, but I have the concept.
EDIT2: Ok, I got that pretty much functioning, it was easier than I thought. Now everywhere, I just got to put $title= everywhere!
it may be a little late in your implementation to do this, but the way to do it is to store all the output in a variable (or object) until the *entire* page is ready, and then echo it. e.g., instead of
<?php
session_start();
?>
<!doctype html>
<?php
$head = "<title>Example</title>";
$head .= '<meta name="content-type" content="text/html; charset=utf-8"';
echo $head;
// blah blah blah etc.
?>
you'd have something more like
<?php
$head = "<!doctype html>";
$head .= "<title>Example</title>";
$head .= '<meta name="content-type" content="text/html; charset=utf-8"';
$body = // blah blah blah whatever;
// ...
$page = $head.$body;
// nothing has been output yet; just saved to variables
// you can also use output buffers for this purpose
// and the very last line would be
echo $page;
?>
this way, you can work with anything you need at any point in the code without worrying about whether or not something's been output to the browser yet.
fileserverdirect
08-04-2010, 01:10 AM
Thanks, but yeah, I got it covered, but any idea's on the category system, homepage, the css for the menu or whatever... (see last post)
james438
08-04-2010, 03:47 AM
I kinda like the idea of using categoryID to determine the category. It is simple and versatile. I think a simple if statement would do the trick with fewer lines and be a little simpler though, but either is good.
Has there any talk of a comment or forum system yet for your new site?
As far as I can tell it looks good enough to publish. I am pretty sure that your site will continue to evolve after you put it up.
fileserverdirect
08-04-2010, 05:12 AM
I just figured out an INGENIOUS solution that beats switches and if statements:
function categoryId($i)
{
$c=array(1 => "Functions", 2 => "Mail");
if(is_numeric($i)){
return $c[$i];
} else {
$n=array_flip($c);
return $n[$i];
}
}
Amazing, this is defiantly going to be a script on the site, but of course, more generalized.
It's getting late here, I will finish up the categories system tomorrow and then work on the front page, this site is really coming together.
Has there any talk of a comment or forum system yet for your new site?
Ugh, a forum system would be too complex for this basic site, and to implement a fully-fledged 3rd party commenting system to work with just one page (mod re-write remember) is a pain. I might wind up coding one down the road, but it seams a little too complex, having to link each comment to a script, order by date, moderator deletion, captca, etc. It's a big process, and it will eat up my host's 50 MB MySQL database limit (Even though I have over 5GB web space!) for sure.
james438
08-04-2010, 08:08 AM
Installing a high quality forum is actually free and easy: phpbb
Having 50MB of database space might be a problem though.
Beverleyh
08-04-2010, 08:17 AM
Plus you can integrate the members login across-site to allow member-only (or admin only, or specific group only, or specific member only) content/functions/interativity: http://www.dynamicdrive.com/forums/showthread.php?p=233216#post233216
It could be a very valuable resource.
fileserverdirect
08-04-2010, 05:17 PM
I've setup a phpbb forum system for a client once, and it's just too much for this site right, now, maybe later down the road, plus I already have a fully functioning user login system, separate. And like I said, it would be a nightmare with mod_rewrite. Meh. Anyways, let me just get a fully working basic site done before I add a forum or commenting system.
If you show me how users are logged in, I have a XML-based comment script that could probably be integrated without too much trouble
fileserverdirect
08-05-2010, 12:48 AM
Like I said, a comment system is too complex for the site at this moment, but when I do eventually add one, It will probably be from scratch. Anyways, I just finished this pagination, wait... no, I'm not really sure what the name is; basically your location, put into highly-stylized "matt black tabs" (even though they're blue :)). I also finished the category system. You can see an example of both here: http://sharedphp.onionhouseonline.com/snippet/categories (Most of the scripts are just tests).I'm now working on the homepage as you read this.
fileserverdirect
08-06-2010, 07:33 PM
SHAREDPHP.COM (http://sharedphp.com)
Yep, I got the domain. I think I was overcharged though, go daddy made me pay 11.60 for it.
---
Anyways, It's about time for all of you guys to have an account, even though the site isn't *finished*. Goto http://md5.md type in your desired password, then private message me the hash with your desired username (or I'll just use dd's) I'll post here when they're all set up. Once in, try out all the features, I'm going to put up a list of bbcode later tonight. Don't make any real posts, just yet. When we go live-live (like for real), posts should look something along the lines of this: http://sharedphp.com/snippet/Output_buffer_code_generator . I am still working with making the wizard into a table, so that it will look a little nicer.
---
I am going to another internet-less camp for a week, then going sailing with my family for a few days (I need to get myself a netbook). But from there I can talk\program from the library on the island, and my mobile phone.
---
I'm just about to finish pagination, some pages already have it. For now, the page limit is 2, because there isn't more than 10 test entries, to try it out; but it will be 10 in the final.
djr33
08-06-2010, 11:29 PM
I think everything is looking good. I'm back from vacation now, but actually still busy because now I'm going to move then start a new program in school. So I'll still not be completely involved for a while.
But I'm impressed by the site.
That amount is about right for godaddy since the registry has increased some of the fees slightly, maybe taxes. Godaddy's profit is still about the same I think. And it's still cheaper than most sites-- let me know if you have another source for cheaper domains though.
The only thing that bothers me on the site is the bar at the bottom. I'm currently on a small display, so that might be part of it, but I find the static position to be really distracting and I don't like the copyright. I think you should definitely take credit for making the site, but by phrasing it as you did it feels like this is just some (unimportant) component of a larger (important) site. If this is going to be successful, it will need to be its own, independent and useful, entity. Having it attributed to another site doesn't give that feel. One way to fix this would be switching the position to just the end of the page (not static, scrolling with the rest) and that would really diminish the visual impact and probably not be in the way. Alternatively I'd suggest simpler phrasing ("copyright notice", etc) or perhaps just using your name. There's nothing wrong with using your name on the site, but using your company seems like it's less important somehow...
Just something to think about. You've certainly put enough work into this to credit yourself however you'd like, but I think it'll be best as an independent thing, perhaps with an "about" page that explains the mission statement and who designed it.
let me know if you have another source for cheaper domains though...
I just bought a .com domain for a client; paid $7.99 at 1&1
The site looks great. One cool thing (I don't know if it's intentional or not; but I do like it): the navigation tabs "under-lap" the header bottom border. Unique!
(I see it in Fx3.6 on Ubuntu)
Edit #2 (@djr below):
That's a first-year deal. Goes up a buck the second year.
djr33
08-07-2010, 12:32 AM
Godaddy used to be that but then they said the (external) fees/taxes went up (a couple times). Interesting...
fileserverdirect
08-07-2010, 12:42 AM
Oh well, I also had three other domains expiring, and it was easier to renew the all of them and add sharedphp.com (I like how I can use .com now), and thats why I felt like I was getting ripped off, because I did pay 7 bucks for each at the time.
djr,
I took your thoughts into consideration and: http://sharedphp.com I'm going to admit, it looks foolish on small pages, but great on bigger ones. It's eventually going to be linked to an about page. Maybe I'll just remove the colored space beneath the footer, or fill it up with google ads.
traq, didn't see your edit, Hmmn, that's interesting, I'm running 3.6 on Windows 7 and it doesn't do that. Neither Chrome, IE 8 (surprisingly). However I have seen that bug on my mobile phone, and some "Public Web Browser" (custom public library browser crap). I'm going to fix it now.
should be fixed now, oh and that screenshot was uploaded before I fixed it. FYI.
djr33
08-07-2010, 05:12 AM
I think that looks better now, but as I said I'm biased by this small screen. On a larger monitor it might fit better, but on a larger monitor it would probably should the whole page too so it wouldn't be relevant. For now, that's a good option, though the coding before was a bit more impressive... haha.
fileserverdirect
08-07-2010, 05:46 AM
...that's a good option, though the coding before was a bit more impressive... haha.
What do you mean? position: fixed is more complex?
djr33
08-07-2010, 06:55 AM
Yeah, slightly. I just mean that it looks more complicated, like there's some sort of interface rather than just simple page layout. But in the case of this site, just a plain layout is probably best, anyway.
fileserverdirect
08-08-2010, 01:16 PM
I am going to another internet-less camp for a week, then going sailing with my family for a few days (I need to get myself a netbook). But from there I can talk\program from the library on the island, and my mobile phone.
Just making this clear.
have fun. the site is looking good.
BTW, i don't think watersports and netbooks necessarily go well together.
james438
08-09-2010, 04:11 AM
If you have a godaddy account you should have 1GB databases available to you. Large enough for a decent forum like phpbb if you want. I don't think it would be appropriate to use DD's forum system as an offshoot of yours.
fileserverdirect
08-15-2010, 01:22 AM
Ok guys, I'm out of camp and now on to vacation, with limited internet access (better than nothing). I was able to get aproved by AdSense and I now have put ads on the sidebar and footer, and I may put individual ads on top of articles. I also have Google Analytics set up. I also applied to BuySellAds.com, and I'm awaiting aproval.
If you have a godaddy account you should have 1GB databases available to you. Large enough for a decent forum like phpbb if you want. I don't think it would be appropriate to use DD's forum system as an offshoot of of yours.
I just buy domains from them, they don't host my sites, I'm using Byethost.com for hosting.
Because I have been out of it for awhile, is there anything else you guys think I should add to the site (other than comments\forum)?
james438
08-15-2010, 05:49 AM
heh, sorry, I just like the forum idea. Mostly so that people can point out errors in scripts or ask questions about how to use a script or modify it.
You could always use one of my databases. I wouldn't notice. I have 10 available to me and I only use one. There are two others that I started, but never deleted. The unused databases that I have were based on older versions of MySQL. I forget why I needed to upgrade to the latest MySQL database though.
Moving on to a non forum topic though; I have a few PCRE that might be useful could they be submitted? Some I created myself and some I found on various forums. I do have a few other simple php scripts as well, such as a daily quote script, a simple website editor script, and maybe a search program.
djr33
08-15-2010, 03:23 PM
Regarding comments, there should be some way to comment on the script. A full forum might at some point be helpful, but not needed yet. For a while, an email contact script, assuming someone wants to go through them all (again, probably limited for a while), would be fine. At some point a system like on php.net with comments on the page might be nice, but I'd also rather have them organized instead of just a huge list of chaotic comments: php.net is nice in some ways, and the comments are useful sometimes, but generally they're just very slow to read and therefore difficult to learn from.
And James, I think you should submit anything you have. Doesn't mean it'll all be accepted (the standards should be kept reasonably high while still expanding the collection), but more submissions is always better.
Additionally, unlike DD, this site will be able to accept very specific and/or limited coding as long as it is useful in some context: for example, a single function will be useful, even if it's only a few lines, as long as someone may need to use it.
fileserverdirect
08-17-2010, 01:58 AM
That brings up a question, should anyone be able to create an account and submit material, I was just going to allow a select few (like you guys) to contribute, However, if I did open it up to allow everyone, submitted content would have to go through approval, and that sounds like a pain.
Also, about user registration, is it necessary for comments, or could it be one of those Name\Email\Comment boxes beneath each post? I wasn't planning on having an open registration, login was only originally meant for contributors... Thoughts?
james438
08-17-2010, 02:22 AM
I prefer having the people that can submit scripts be open by invitation only. This way you can have members that you trust to have a high likelihood of contributing quality/useful scripts that can be moderated easily and are less likely to need moderation.
As far as who is allowed to post comments I can see pros and cons to all options. You could postpone a comment system until there are a number of quality scripts. You could also allow those who are allowed to submit scripts to be able to moderate comments as well. I don't really see significant difference in the type of comment system. I imagine that the easier it is to comment the greater likelihood for spam and to organize the comments how you want. I think that it would be important to see the date the script or comment is posted though.
djr33
08-17-2010, 04:50 PM
Spam will be a problem regardless. If it doesn't require registration, it will be a bigger problem. However, since it is not a well known forum (such as vbulletin or phpbb), it's less likely to get the generic spammers and if you add a captcha or other method, it's likely that the spam will be mostly blocked. Of course that will only work until the site is popular enough to get lots of attention, but at that point I think the spam is a sign that the site is working, so that's not entirely bad.... haha. But it could certainly be dealt with then.
For the comments, my thought was sending an email to an admin for now, so that there is some way to comment on the scripts but not yet a full comment system. Eventually something like on php.net would perhaps be helpful, but we could figure that out in time and see if it's needed or if there's a better way. I do think anyone should be able to comment, but as long as there's some way to email an admin (I'd suggest a form at the bottom of each script, even just the same form, but perhaps with a title based on the current script), that should be fine.
I don't think login should be required for this because there will be more activity if login isn't required, just look at popular comment sites (not forums, but just comments). php.net is again a good example here. However, this sort of comment system doesn't need to happen for a while, so you could for now require login as long as someone can register or find another way to contact to comment on a script...
I don't think it should be entirely limited to users from dynamic drive, though I don't mind the idea of "approved" users. That said, I think there should perhaps be two options: approved users can submit scripts directly, and others can submit scripts indirectly perhaps by email. Of course really only the indirect method is needed and for a while I don't expect that will take too much of your time... at most you'll need to look at... 5 submissions per day? And it's always a good idea to monitor what's on the site.
I, for example, plan to submit whatever I have, but it's not necessarily all useful-- so someone else should take a look to be sure. Quality scripts, and eventually quantity, will be what makes this a good site. That means more submissions and fewer additions.
EDIT:
I wanted to add a suggestion:
I have several "tutorials" that involve real code examples. I think it would be a good idea to allow that on the site as well. Each "script" should have at least a basic description, and some descriptions may have only a little code, but depending on the content either way can be very useful. I don't think it should be only tutorials, but if it's something like my "pretty URLs" tutorial, that has enough code it is useful in that sense, but it also is more about understanding how to use it.
fileserverdirect
08-20-2010, 08:37 PM
Well, after several libray sessions, I was able to complete the form emailer and other things. (Host deosn't support mail(), so I had to go with phpmailer and use my gmail smtp, which took over an hour to set up...)
Here are some things that are done:
1. Try resizing your browser window, watch the sharedphp logo!
2.A "Click to email author" is added below each script\snippet". When you click it, a form appears with reCAPTCHA.
3.Added a reCAPTCHA when adding a new script\snippet.
-----
ToDo:
1.The Email Author will actually email the author of the script and not me.
2.Create a user registration in which new scripts submitted by them must be approved.
3.Create a commenting system (in additon to the emailing script).
4.Finish Contact and About Pages
5. Create User levels such as:
1-Admin (Me)
2-Trusted (You Guys, or others who apply [can moderate comments and maybe aprove posts... I havent decided yet])
3-Approved(Can submit content without each post being verified... )
4-Member(cannot submit entries without each one being aproved)
What do you think?
I have several "tutorials" that involve real code examples. I think it would be a good idea to allow that on the site as well. Each "script" should have at least a basic description, and some descriptions may have only a little code, but depending on the content either way can be very useful. I don't think it should be only tutorials, but if it's something like my "pretty URLs" tutorial, that has enough code it is useful in that sense, but it also is more about understanding how to use it.
I don't think the current wording would be acceptable, but maybe somthing like:
blah blah blah description
.htacsess code: (codebox with the generator for the catch all page)
blah blah blah stuff
php code for dealing with requests: (php code box using explode with "/")
blah blah blah
examples of usage
example 1: if statements with exploded variable to decide content
example 2: yadda yadda yadda
blah blah blah conclusion
Also...
I also applied to BuySellAds.com, and I'm awaiting aproval.
Lol, apparently you have to have over 100K impressions a month! Nevermind, then.
On a side note, I found the reCAPTCHA API to be [U]VERY easy, I suggest you guys checking it out since your always worried about spam, (which I had for breakfast today btw)
fileserverdirect
08-27-2010, 10:25 PM
bump (I don't want to get this thread pruned)
djr33
08-28-2010, 06:42 PM
It may drop below the first page, but there are still new replies to threads over 3 or 4 years old. I don't believe there's any limit on that-- the only time a topic is closed is if it receives too many spam replies and the discussion is over. And that's done individually by a moderator.
fileserverdirect
08-29-2010, 01:48 AM
I guess the pagination is hidden, I now see it stores threads forever. Back on topic, What do you think of the ranking system? Thoughts?
djr33
08-29-2010, 03:42 AM
Ranking system? I must have missed a post.
Do you just mean the list on the front page? I think it's fine.
fileserverdirect
08-29-2010, 04:18 AM
Well, after several libray sessions, I was able to complete the form emailer and other things. (Host deosn't support mail(), so I had to go with phpmailer and use my gmail smtp, which took over an hour to set up...)
Here are some things that are done:
1. Try resizing your browser window, watch the sharedphp logo!
2.A "Click to email author" is added below each script\snippet". When you click it, a form appears with reCAPTCHA.
3.Added a reCAPTCHA when adding a new script\snippet.
-----
ToDo:
1.The Email Author will actually email the author of the script and not me.
2.Create a user registration in which new scripts submitted by them must be approved.
3.Create a commenting system (in additon to the emailing script).
4.Finish Contact and About Pages
5. Create User levels such as:
1-Admin (Me)
2-Trusted (You Guys, or others who apply [can moderate comments and maybe aprove posts... I havent decided yet])
3-Approved(Can submit content without each post being verified... )
4-Member(cannot submit entries without each one being aproved)
What do you think?
I don't think the current wording would be acceptable, but maybe somthing like:
blah blah blah description
.htacsess code: (codebox with the generator for the catch all page)
blah blah blah stuff
php code for dealing with requests: (php code box using explode with "/")
blah blah blah
examples of usage
example 1: if statements with exploded variable to decide content
example 2: yadda yadda yadda
blah blah blah conclusion
Also...
Lol, apparently you have to have over 100K impressions a month! Nevermind, then.
On a side note, I found the reCAPTCHA API to be [U]VERY easy, I suggest you guys checking it out since your always worried about spam, (which I had for breakfast today btw)
Re-Post
djr33
08-29-2010, 05:49 AM
The ranking sounds fine. But I'd suggest moderators or VIPs instead of "trusted". The name is irrelevant, but there should be something more to it than just "trusted", or just group us with the approved members.
fileserverdirect
11-14-2010, 08:31 PM
Quick Update: School has been a burden here in the past months and it has really taken a toll on my free time. On September 3rd, I was asked to do a website for a decent amount of money, so of course I had to say yes. From that point I was dedicated to that project, and in fact, I just finished it. I now plan to work on sharedphp with my full coding attention (unless of course I get another paying offer). My clients website was obviously requesting much less than that of sharedphp, however I took this chance to code in a completely new way, much neater than ever before. However I kind of went overboard and wound up doing 10X the amount of work than I originally thought (or for that matter, charged). Anyways I learned a great deal of jQuery, Ajax, PHP classes/objects, and a bunch of CSS 3.0. How does this relate to sharedphp? I recently looked at my source code, which is basically 1000 lines of procedural code, no javascript/jQuery,no ajax, no classes. It frankly looked like dog crap. For example, I don't know if you know this but the content section is just an if/elseif. I don't know what really to do now, to re-code it in a cool ajaxy, jquery-y, classy (lol) kind of site; or just continue coding on top of this horrid, (yet functional from a user's aspect). What should I do?
Beverleyh
11-14-2010, 09:29 PM
Hi Ben,
You come across as being conscientious with your desire to do your very best work for your recent client/project (even at your own expense) so personally I think you'll be kicking yourself if you don't backtrack and take this opportunity to improve your sharedphp code.
if you know you can do it better, go ahead and do it and be proud of what you achieve :)
Also, thank you for continuing with your project - I'm sure it will be a wonderful resource.
absolutely - backtrack.
You've got a great working example of the html output you're looking for, so you won't be starting over from scratch. If you've got a good handle on PHP objects/classes, I'd definitely recommend starting there: ajax is cool, but it's not really necessary for the basic stuff. Focus on the backend first.
fileserverdirect
11-14-2010, 11:59 PM
Well, I guess I've got a lot of coding to do. I've been working with Nile on the layout, so aI guess a coding/visual makeover is done. I had a question on how you guys start a "site" class. For my client, I made a master "site" class and had classes and objects layered through there. However the problem became that in order to follow a SIMPLE method, Something like $site->layout->element->new("br"); was required. This became an issue, so I combined a lot of features together like $site->layout->create("verticalmenu");, which had <br> inculded. Then that became too much so I made $site->sidebar();. My index became flooded with these calls, so I reduced them.... the ENTIRE index has two lines: include "library.php"; $site->init();
This is obviously not the way to harness classes, so I wonder how you guys balance Procedural Oriented Programming (POP) and Object Oriented Programing (OOP).
if it's a function that might be used in more than one place, make it an object (or a method in a class full of related methods). HOWEVER, as you've noticed, it's very counterproductive to abstract-ify bits of code that are excessively generic. So,
$site->layout->create('verticalmenu')would be appropriate, but something like
$site->layout->body->div->p->create('br') is just silly (or insane - you might as well create a similar function for every element).
Break your site into manageable chunks and work backwards from there.
Also, remember that not everything needs to be abstracted into a single class. So, instead of
$site->layout->create('verticalmenu')you might have something more like (in a file called layout.php)
$layout = '
<html>
<head></head>
<body>
<div id="header">
'.$this->create('verticalmenu').'
</div>
</body>
</html>';
return $layout;
}
I've been working with Nile on the layout
:D Fixed:
Nile has been working on the late for two hours while I sit there and talk about pixel pops.
Haha - jk,
djr33
11-15-2010, 04:06 AM
Fixing the code is not a bad idea, but at the same time I'd recommend that you focus on finishing the site, except where improving the code first will help finish the site faster. Reworking the basics is probably fine, but if a certain section is functional as-is, there's no reason to change it immediately and you can be more productive getting the whole site up. That way you will be able to redesign on an active site-- you'll know what is needed, you'll have worked out all the layouts, etc.
Of course if it won't take very long to rewrite it all, that's not going to hurt anything either. But don't be too distracted by the code that you don't finish the site :)
And regarding my participation, I'm still very busy with my current project (a language learning site), but in the process I've developed a number of classes and functions that may be useful. In fact, I recently completed a whole wiki (written from scratch) though attempting to extract that from the rest of my site would be a nightmare, but maybe still a good place to start...
fixed: "Nile has been working on the late for two hours while I sit there and talk about pixel pops."
...lol
fileserverdirect
11-15-2010, 05:33 AM
@traq\Nile: I take my pixel popping very seriously from a Web 2.0 graphic desgin standpoint, it is no "laughing out loud" matter /sarcasm. (No really I made a whole video tutorial (http://www.youtube.com/watch?v=-lO5nJY_JPU) on it)
--
Fixing the code is not a bad idea, but at the same time I'd recommend that you focus on finishing the site, except where improving the code first will help finish the site faster.
I think I'm going to take this approach and finish this site before I make any huge layout or core coding changes. It works, no matter how sloppily on the back end. (Those breadcrumbs and pagination were a PAIN to do, I believe over 1/4 of the coding was just for that.) I don't want to have to redo that whole system, just to make fit snugly into classes. However I may add some jQuery here and there, but not ajax. The site is VERY dependent on mod_rewrite. Adding #hashtags would just be over-complicating things. Yes, I shall finish everything first, then add on to that. But I don't know how I would code in parallel, using the same database\file structure and whatnot. I have never actually fully done a parallel coding whereas major updates were transferred from server to server. I would assume keeping a synchronized testing server where all I would have to do is re-upload the new files. Would I have to block access using htaccess while I upload new files? How do I go about applying massive updates?
djr33
11-15-2010, 05:13 PM
That's a big question, something I need to figure out as well. I've launched my current site (semi-officially-- I'll announce it here once it's more or less 'complete'), and I'm still working out some details, on the live site. That's not too hard (disabling pages that aren't ready, etc), but once it is done and people are actively using it, creating the next version/improvements will be difficult.
There are three approaches:
1. Create a duplicate server-- hardest, but obviously most effective. The only big problem there is that the domain name (in all links) will not match so you will have trouble testing interaction between different URIs (including loading media like images).
2. Actually generate two sites using the same site, based on sessions. Essentially you could make an admin version so that if you log in as admin then view the index you will see the new design. If you log in as a regular user (or are not logged in) you will see the old. Simple ifs, but lots of them, so I imagine this will get complex.
3. Edit on the go and hope for the best. Perhaps test some pages locally then upload and hope nothing crashes. You'll end up having some downtime and live testing (users can't save a change or something) but this is certainly the easiest to set up.
I think I'll go with (2) and work on one part of the site at a time to keep things simple. Of course (1) is a good idea, but it's a major thing to setup.
If you decide to go with two sites (a testing version and a live version) - which is a good approach - the best thing you can possibly do is separate out all the urls from the beginning. Use a global settings file to define specifics:define('SITE_URL','www.example.com');and use the defined constant in all of your scripts (use some thing like $link = '<a href="'.SITE_URL.'/page.php">'; instead of $link = '<a href="www.example.com/page.php">'; ). Do the same with everything possible: database credentials, email addresses, paths to resources, configurable options, anything that is used in more than one place and needs to remain consistent. You'll be grateful later.
fileserverdirect
11-17-2010, 09:58 PM
Ok, I think I will go with the separate server (just a subdomain on sharedphp). In the htaccess, I will re-route all requests (except for my IP) to another site with a notification of downtime; then I will re-upload the changed files, fully test them out in the new environment, then re-edit the htaccsess to allow all requests. Sound good? Anyways, I could prep the site for launch as it is pretty much done (as a beta). I will add the sign up and about pages, then I guess, it's ready for launch. Any suggestions\comments?
djr33
11-18-2010, 01:40 AM
Fine, assuming the modifications don't take a lot of time and that it's reliable once you fix it.
fileserverdirect
12-28-2010, 02:53 AM
Yep, I'm launching the beta version TONIGHT. I need some scripts to start with before I start advertising.
You are all welcome to join here: http://www.sharedphp.com/join
Click "Apply Now" and under qualities just post your dynamic drive username and I'll enable you account either today and tomorrow. Passwords are md5'd, so don't worry! Before you start contributing, I will give an explanation of the BB code later on.
----
Major contributors (you guys) are listed here: http://www.sharedphp.com/about
----
Please report all bugs or suggestions in this thread or on the beta page: http://www.sharedphp.com/beta
----
Thanks!
Ben
djr33
12-28-2010, 07:42 AM
Congrats on nearing completion. I need to add this to my long to-do list, but keep posting here with updates. I haven't organized the couple scripts I have, and I may have more later as well. Feel free to send me a PM since I do intend to participate, but may forget.
Schmoopy
12-28-2010, 12:31 PM
I like the idea of this site, good luck with it :)
fileserverdirect
12-28-2010, 05:17 PM
Here is the format for the custom bbcode used on sharedPHP:
text in link If you uploaded any additional files with you post, this will create a link to the zip file containing them. Note that this is not required if you uploaded files. A link at the bottom of the page will appear regardless.
----------------
text inside box creates a box using the common UI seen throughout the site. Useful for warnings or special notes. (Please double slash your slashes here as it is necessary for the script to function.)
----------------
form code creates an auto-generator form for users to customize their code with. Surround all bbcode below here with .
----------------
Label for text field creates a text field for use inside [wizard].
----------------
Label for text area creates a text area for use inside
----------------
Default value is by far the most important bbcode in use. Set the same name as a text field and upon submission it will replace the default value. See the example below:
Your code:
$email="enter@youremail.here";
would be changed to
Your Email Address:
$email="enter@youremail.here";
(Of course you would surround the php code in php tags)
This ensures that impulse copy\paste-ers will still get valid code whilst people who wish to customize before copying are thankful for making their life easier.
There are a few examples of this usage throughout the site already and I suggest you taking a look at it.
----------------
Other BBcode includes: B,I,U,PHP,ICODE,SIZE="x",COLOR="x". I will add more and perhaps modify the above coding in the future, so stay tuned!
fileserverdirect
01-07-2011, 03:28 AM
SHARED PHP HAS A TWITTER! (http://twitter.com/sharedphp)
The main reason I have done this is to provide quick little news updates about the site, maybe even feature some scripts or whatnot. Also, Nile has joined and already submitted a few scripts. I strongly suggest you guys join at http://sharedphp.com/join ! Even if you don't submit scripts right away. For example I was scouring through my code and I found a handy snippet. In 15 minutes I turned it into a great little post: http://www.sharedphp.com/snippet/Auto_Array_Flip
Now, I'm not expecting any of you to do this, but I also spent an afternoon and developed this full script: http://www.sharedphp.com/script/Image_Tracker_v1
I hope this will allow you to see the difference between the scripts and snippets section.
---
If you are new to this thread or viewing it for the first time, I suggest you check out http://sharedphp.com which is a result of this thread's 140+ posts!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.