126

(6 replies, posted in General discussion)

Yeah, altho i only use $_ vars and require ppl to run updated software smile, 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.

127

(6 replies, posted in General discussion)

Ahh, yeah i see how that can be usable.
Is it speed/security/failsafewise as stable/good as an ordenary if-else-ladder?

128

(6 replies, posted in General discussion)

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?

129

(6 replies, posted in General discussion)

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 smile

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)?

130

(19 replies, posted in General discussion)

I agree with Frank H, just above the sig, and make the text italic so it stands out of the post-msg.

131

(21 replies, posted in General discussion)

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.

132

(15 replies, posted in Feature requests)

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 big_smile

133

(15 replies, posted in Feature requests)

Perhaps even release a separate zip/gz with only the files that was edited?
Reaching here tho smile

134

(7 replies, posted in Programming)

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 smile

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...

135

(7 replies, posted in Programming)

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.

136

(7 replies, posted in Programming)

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?

137

(9 replies, posted in Archive)

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.

138

(9 replies, posted in Archive)

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 . "";

139

(9 replies, posted in Archive)

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...

140

(3 replies, posted in PunBB 1.2 troubleshooting)

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.

141

(22 replies, posted in Archive)

Jag hade inga problem att markera enstaka ord varken i inlägg eller topics på ditt forum.

Använder w2k firebird 0.6

142

(3 replies, posted in PunBB 1.2 show off)

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 smile

143

(7 replies, posted in Archive)

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? smile

144

(3 replies, posted in PunBB 1.2 show off)

http://forum.nonet.org

It's running on pgsql, fresh 1.0 preview install.

Abuse it, don't expect much speed tho...

145

(5 replies, posted in Feature requests)

Great, keep it up.

146

(5 replies, posted in Feature requests)

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...

147

(5 replies, posted in Feature requests)

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...

148

(4 replies, posted in Archive)

TwaN wrote:
Har du provat att logga ut och sen in igen?

Jupp, inga probs här.
Använder Firebird 0.6 engelsk

149

(4 replies, posted in Archive)

Inga probs här på www.punbb.org är inloggad å stuff...

150

(19 replies, posted in Archive)

Kontrollera att din mysql-server är startad, och att din databas existerar.