Yeah, altho i only use $_ vars and require ppl to run updated software , i always terminate my if-else/switch-case with a default-block "Error contact admin" or something.
I think it's good code-practice to do so.
You are not logged in. Please login or register.
PunBB Forums → Posts by RNilsson
Yeah, altho i only use $_ vars and require ppl to run updated software , i always terminate my if-else/switch-case with a default-block "Error contact admin" or something.
I think it's good code-practice to do so.
Ahh, yeah i see how that can be usable.
Is it speed/security/failsafewise as stable/good as an ordenary if-else-ladder?
Ahh, i c, you just loop through the arrays...
In the following line: $forums_to_process = (isset($_POST['update'])) ? array_keys($_POST['update']) : array_keys($_POST['forum_name']);
What does the '?' and ':' do/mean?
Not really sure where to put his Q since it's a php-coding, sql-update Q from the category/forums section in the admin-area from pub
How have you solved the Update All-stuff when you update all forums/categories for among other things position etc?
Do you make one update/forum, or a multi-update directly (if it's possible)?
I agree with Frank H, just above the sig, and make the text italic so it stands out of the post-msg.
I'd say it doesn't matter if there is a pretty flexible BBCode-system-thingie that one can extend if special tags is needed for example.
Yes, i realize it will be some more work.
It could surly be done with a script of some kind, that compares the current develop-dir's files with the last release-dir's files with a hash (md5?) and flags those files which does not compare with the old ones.
Or something
Perhaps even release a separate zip/gz with only the files that was edited?
Reaching here tho
Yeah, most of the time i tend to read up on anything new so i at least know a little about what i am about to wreck havoc on
But, since i have some importand site-wide variables in my config.inc.php-file in an array-style, which is already included in the top of every "public" file, i don't really see the point of using constants for anything else then for, let's say, the base_url, dbinfo etc as those are used inside functions, objects and evals in a different way then just storing values.
Other then that, i have pretty much no ideas for it's use...
Now when i have read some more i found " You can define a constant by using the define()-function. Once a constant is defined, it can never be changed or undefined." here under syntax: http://se2.php.net/manual/en/language.constants.php
EDIT: Sorry, slipped into swedish-mode...Fixed.
I've read up on constants today and my first q is; why?
What can a constant do that a variable can not?
Some of the stuff i (think i) have come up with so far:
Constant is global by defaul, variable is not unless you $GLOBALS['variable'].
Constants can not be overridden, ie you can not name a constant the same in two different parts of the script (due to their globalness?), meanwhile variables can be overridden.
You can get a list of all defined constants, as with variables you can not (unless $GLOBALS can be used?)
EDIT: I cant find a way to undefine constants...Is there one?
What scope of usage do constants deserve?
Only tru variables that is used throughout the site/app like Directory-locations, hostinfo for db's etc etc.
So, folks, why sould i use or not use constants, and most importantly, for what should constants be used for?
Woppe wrote:
Då får jag dessa felmeddelanden:Warning: Unable to jump to row 0 on MySQL result index 2 in /home/httpd/ws2464/codeshack.se/bannersys/index.php on line 41
Warning: Unable to jump to row 0 on MySQL result index 2 in /home/httpd/ws2464/codeshack.se/bannersys/index.php on line 42
De två raderna är
$sess_id = mysql_result($result, 0, 'id'); $sess_user = mysql_result($result, 0, 'username');
Jag antar att detta är ett framsteg?
Nu får du i alla fall svar från databasen...
Får du likadant svar om du anger ett felaktigt användarnamn/lösenord?
Jag kan tyvärr inte hjälpa så mkt med sessioner/cookies då jag inte haft nån direkt erfarenhet av dom nyligen.
Testa byt:
$punsql = "SELECT username, password FROM pun_users WHERE username = '{$_POST['user']} AND password = ".$md5 ."'";
mot
$punsql = "SELECT username, password FROM pun_users WHERE username = {$_POST['user']} AND password = {$md5}";
alt:
$punsql = "SELECT username, password FROM pun_users WHERE username = " . $_POST['user'] . " AND password = " . $md5 . "";
Kolla i toppen på filen 'login.php'
Men om du vill verifiera username+pass mot punbb's användarlist så gör:
SELECT username, password FROM users WHERE username = '$username' AND password = 'md5($password)'
Får du ett positivt svar från query'n, så var det rätt, annars var de fel.
Vill du att personen skall förbli inloggad precis som vanligt, så skicka dom till inloggningssidan bara och använd dig av punbb's cookie för att verifiera status på resten av dina sidor.
Om jag missuppfattat nåt, så ber jag om ursäkt...
Only thing i can think of right away, is that you have 'localhost:21' in the dbhost field.
Try just putting 'localhost' as port 21 is commonly used with FTP.
If they have different mysqlconfiguration on your host, i don't really know what's wrong.
Jag hade inga problem att markera enstaka ord varken i inlägg eller topics på ditt forum.
Använder w2k firebird 0.6
pg is just so much nicer to administer then my...
haven't quite figured out pg's syntax and much of the other junk in there
Kennel wrote:
Jo, den var fin. Det var varmt som fan, men man vande sig efter ett par dagar.
Och efter ett par dagar var de nästan dags å åka hem igen eller?
It's running on pgsql, fresh 1.0 preview install.
Abuse it, don't expect much speed tho...
Not entierly sure what that code does, but my suggestion was only to make the marker jump in a predictable order in the input-fields.
If the code does so, it's time for me to go te bed...
hmm, it's bedtime anyways...
Suggest ordered 'tabindex' of the FORM elements to make a more logic jump for tab-key.
Example:
In 'Add Forum' the cursor goes in this order when starting in 'Position'
Position
[Options] Admin/moderators only
Update
Name
[Options] Closed
Description
Category
Now, since all forums are listed in a row, i'm not sure how to make a practical solution, but it would nice to have it jump in this order:
Position
Name
Description
[Options] Admin/moderators only
[Options] Closed
Category
Update
More info http://www.w3schools.com/xhtml/xhtml_st … ibutes.asp about tabindex.
One possible solution chould be to add 7 to each tabindex for each forum-loop.
$tab_pos = 1;
$tab_name = 2;
$tab_desc = 3;
$tab_op_admin = 4;
$tab_op_closed = 5
$tab_cat = 6;
$tab_update = 7;
Like this (Loop1):
Position - tabindex=$tab_pos
Name - tabindex=$tab_name
Description - tabindex=$tab_desc
[Options] Admin/moderators only - tabindex=$tab_op_admin
[Options] Closed - tabindex=$tab_op_closed
Category - tabindex=$tab_cat
Update - tabindex=$tab_update
$tab_pos += 7;
$tab_name += 7;
$tab_desc += 7;
$tab_op_admin += 7;
$tab_op_closed += 7;
$tab_cat += 7;
$tab_update += 7;
If anyone understands what i'm rembling about...
TwaN wrote:
Har du provat att logga ut och sen in igen?
Jupp, inga probs här.
Använder Firebird 0.6 engelsk
Inga probs här på www.punbb.org är inloggad å stuff...
Kontrollera att din mysql-server är startad, och att din databas existerar.
PunBB Forums → Posts by RNilsson
Powered by PunBB, supported by Informer Technologies, Inc.