G'day I've got a script that i've downloaded of the net (original script from maaking), but have edited to suite roughly what i'm requiring, except I want to join 2 parts together, and have no idea on how to program it. What i've got is a login system which is for users & admin, but what i'm wanting is an additional field for user permission (ie, 1=admin, 2=semi admin, 3=user), but instead of having 2 different logins as it currently has (1 address for user & 1 for admin), I want it so that if the user is an admin, they will see more the admin links aswell as the standard user links. Same applies too if a semi-admin logins, they will see at least some of the admin links as defined. Attached is the source code in zip file, and below is a mockup list of users. Also there is 2 other things that i'm totally unsure of. 1 is that the script has to run within my website design, and currently during testing i have it set in a iframe. The other thing is I think the script needs abit of cleaning up as its been changed a tiny bit to suite my needs. sample user database: username, password, email, fullname, address, phone, mobile, renewal, permission 100, test, , Mr Test, 1 Test St Testville, 1234657890, 1234567890, 2008-12-31, 1 101, test, , Mr Tester, 2 Test St Testville, 1234657890, 1234567890, 2008-12-31, 2 102, test, , Mr Tested, 3 Test St Testville, 1234657890, 1234567890, 2008-12-31, 3 Any assistance is greatly appreciated. This project is for a non-profit society dealing in historic public transport. Please note that any assistance from anybody and source code will be acknowledged once the website is up & operational.
Have you thought about using a free CMS? If the requirements of your project aren't too specific, software like Joomla or Drupal would make your life much easier, saving you from the headache of developing, maintaining and securing a custom app. For your kind of site, IMHO, it isn't worth to reinvent the wheel. Obviously, the right choice depends from the exact specs of the project, but these are my 2 cents.
$username = '100'; //example user $query = "SELECT * FROM users WHERE username ='$username' LIMIT 1"; $result = mysql_query($query); $row = mysql_fetch_assoc($result) switch $row['permission'] { case '1': $menu = 'member, style, settings, forum'; break; case '2': $menu = 'member,style'; break; case '3': $menu = 'user_cp'; } //show menu echo $menu; PHP: Yup... like lordofthelake said... it isn't worth to reinvent the wheel.
G'day guys I've looked at CMS scripts, both flatfile & sql based, and whilst there are some half decent ones out there, and also some very hard to understand or manage CMS scripts, i've came to the conclussion that adding purpose built scripts into the existing design makes it a fraction easier (especially for someone like myself still trying to get the full gist of php & sql). From the code you have provided 'misbah', and this is where im honest to say I probably know very little to what most do, where exactly does that section of code suite best? There is currently a field that doesn't get used, can't remember what its called, but i've removed most mentions of it from the 'users' scripts on both user & admin where I can see. And does that snippet replace any full scripts or is an addition so that it looks at the user level and defines what the user can access? Thanks for your assitance/comments so far.
BT_Buses, can you give us a whole image of what your site is meant to do? I see the subject is history of public transport (correct me if I'm wrong), but you haven't told us what the script should do. If you tell us what you have in mind (not only the admin-logging part), I think we'd be able to give you more help than we're doing now (having a clear image always helps) and maybe give you a good advice about a simple pre-built solution.
Ok, the site is for this society I am apart of that is into heritage buses & restoration. The site has general info like 'about us', 'upcoming events', 'membership', 'contact us', 'our fleet' and really just basic stuff like that. The login/admin section is more so for the financial members of the club so that they can log in, update their personal details (ie, address, phone & email). But then if they are an administrator, they also have the access to add/edit/delete members/details. Originally the script that i've provided in the zip format was that anyone can register, but that is not required, only somebody within the committee can do that as the information retained is just their personal details. But then the other part of the admin is the subadmin (which really equates to somebody who requires the address details, but isn't apart of the membership committee), can login and change their own details only, but can view the membership listing of the clubs members for mailing purposes. Except for the online shop script and the photo gallery script which im currently investigating, all other pages are done and dusted and work exactly how I believe they should. The major pickle in this equation is this current login/admin script. The actual script works fine, all i'm really looking for the functionality to be merged so that a member who has admin status doesn't need 2 login accounts, just one and if they're an admin, can view all admin links including 'update personal details', or if they are a semiadmin, they can view 'update personal details' and also 'view membership listing'. In some point in time, it would be good that when viewing the membership listing, it can be somehow exported to word or something for printing of mailing labels (but thats a long term project). Otherwise, most other scripts/cms that i've found, I can't have the fields I want, which are: Username (which is their member #), Password, Name, Email, Address, Phone, Mobile, Renewal (their membership renewal date) and User Permission. As mentioned previously that i've found some that work really well, and did exactly what I wanted the script to do, except I couldn't add/edit the fields. I hope that makes it abit clearer. If not, please PM or email me.
Everything is clear, thanks. Well, for the purpose of the site, I'd have used Drupal 5.x + a bunch of modules. Listing here just to give an idea. Userprofiles (included in the default installation): fields you need in the user profile (Address, Phone, etc) Ecommerce or Ubercart (shopping) For the gallery, there should be at least 4-5 doing the work in the modules directory, but I can't remember the names (I'll search, if you're interested) I'd include the links for the modules, but the system doesn't allow me to post them (yet). For the user permissions, that control is built-in. All included without need of coding. BTW, this is just an idea. If you want to code the system by yourself, you're more than free, and I'll try anyway to give you a hand, when I can.
So in a way, what i've so far done I should just delete and restart using Drupal? An old webhost use to provide such things in the control panel (cant remember the name of it, but had all these scripts that would automatically install for you if requested), but the current webhost allows for only one db and such things like drupal have to be downloaded and installed by the user. That was something I forgot to mention earlier on, thats the other reason why i've gone along the lines of what i've been trying to do.
If your concern is having one DB and not having an autoinstaller (it was Fantastico, maybe, on a cPanel account?), this shouldn't be a problem. Drupal can be configured to use table prefixes, so it won't get in conflict with other scripts. For the installing, if you PM me your details, I can do it for you in a matter of 5 min... it's quite straightforward. Maybe you can play with Drupal while you keep on developing this, so if you don't like the CMS, you can continue from the point you were? Obviously the site is yours, mine is only an advice.
Thanks for your responses so far guys. Well today, between me & another friend (who also has limited knowledge in webprogramming), we've spent the last 10 to 11 odd hours (with the occassional coffee break as relaxation), we downloaded, installed and edited Drupal (which all worked), and whilst the functionality is great and there are areas we like in it, but others not really sure about, we do have some other 'flatfile' type scripts that we use (and have been for sometime on the existing sites), and also trying to get a design that we like but also works, especially between the 4 browsers I test the site on (ie7, FF, GC, AS). So I feel at this stage (considering i've got less than 3 weeks to have the new site up), that with the couple of things i'm needing done could be easier to go down the track of what i was originally heading for, and that was a login/user management script (or use the code posted in the zip file and have it edited to allow what i'm needing it to do), and secondly, is a very basic image gallery script. The image gallery script, i've tried to use ones i've had in the past, one was LGR or something, and worked well, but as the website deals with alot of 'includes', and also updating the LGR gallery script to the lightbox feel, it didn't quite work, so what i'm wanting is a script that when called, will display pictures from a folder (and even sub folders would be a bonus) as a thumbnail (which is automatically created when the page loads or first time viewed), and then when the photo is selected, will display like the lightbox style does. What I prefer, and have done with these scripts in the past is no admin features, just I login to my ftp acc and upload the full size images into the correct directory, and the script did the rest for me. Unfortunately after spending 11 odd hours plus the past few weeks i've already spent on this project, my patience is wearing thin (probably cause whilst im trying to learn things, I just don't seem to get that much further). And just as a broader picture, this is how i've done the site design: index.php, calls header & footer when user clicks on a link, say About Us (index.php?page=aboutus), index.php will call header, footer & aboutus.php All that works fine, except on some of these extra things i'm wanting (like the photo gallery), so therefore needing just a single script or somethign like that. As I mentioned before, any help is gratefully appreciated, and even more so any help received, those people will get mentioned on the website as a contributor.
After spending several more hours on the Drupal script, there are items in there like adding extra user fields (address, phone etc), and apart from redesigning or more so coding the css styles to suite the style intended, trying to find one seems to be even harder. So I think in a way now, yes I believe I am trying to re-invent the wheel, but the upside is that this project I am working on will have its benefits for other similar interests groups also, so it won't be a complete waste on just one site. So any help is greatly appreciated. If you would like to correspond by messenger, please drop me a PM. I am willing to do what I can to assist, but am at the stage of believing that my purpose built script will be more focused on what the club requires than having items that could/would never get used. Cheers
About the profiles, this manual page can be of help for you? For theming, I'd advice you to start with the Zen theme, that can be styled using the CSS. If you need more advices, don't hesitate to ask.
After another 2 days on playing with drupal, i'm not getting that much further, in fact i'm probably getting behind trying to get all the content out, so i've definately decided to go with the original plan that I was wanting help for. All I am looking for is a simple 'login/logoff' script, whereby admin only can administer new users, and also edit/delete users, but are users themselves (without the need for 2 seperate logins for them), and the user once logged in can also update their own details (and the details must include username, pwd, name, email, address, phone, email, renewal, permission). And the script/s must be able to be implemented with the original site design that I had made up. Thats all i'm looking for! I've downloaded other scripts, and also read up on tutorials and tried snippets, but I keep getting stuck at the same point everytime. I do have another script that a friend had made for me 2 years ago, which pretty much works except for one feature, and that is editing the users own profile, and thats after editing the hell out of it for this new project. Unfortunately his workload is pretty full on, and this script only requires to read the data in of the current user, so they can then edit the necessary fields and click 'update'.