New Maps for the mapcyclevote

like jump? feel bored with algiers?
just know a nice map and nobody wanna listen?
post it here!

Re: New Maps for the mapcyclevote

Postby Pirat » 02.22.12

wurst wrote:yea.
we have automatic backup btw, db and flies

Hopefully, we won't have to make use of it in my clumsy and unillumined
attempts to merge our databases. ;-}

.
Pirat
Godlike
 
Posts: 1447
Joined: 03.29.10
-----tdm:  
nick: Pirat
skill: 507.365
kills: 402
deaths: 636
ratio: 0.63

Re: New Maps for the mapcyclevote

Postby havoc » 02.22.12

Pirat wrote:
havoc wrote:just add a table for comments with these columns:

comment id
map id
date/time
user id/name/whatever
comment text
type of comment

with type of comment being one of 3 - a pro, a con, or just comment
[...]
p.s. your primary in the maps table should be the map id

AFAIK, this won't work, as in your table, there is more than one row
for each map (because there can be more than one comment per
map). Therefore, the map id is not unique and thus cannot act
as a primary key.

Would should work, however, is using a composite primary key that
comprises all columns. I'll probably use such a key for all of my
tables except for my main table where the map name/id is the
primary key.



i think you are confused or something m8...
in your table the primary must be the map id, in my table the primary must be the comment id, with map id marking which comment is related to which map.
"It is the first responsibility of every citizen to question authority."
-- Benjamin Franklin
User avatar
havoc
Godlike
 
Posts: 674
Joined: 06.26.09

Re: New Maps for the mapcyclevote

Postby havoc » 02.22.12

Pirat wrote:List data for the maps are stored in other tables, like urtmaptags,
urtmapauthors, urtmaplicenses (a map can be dual-licensed, for
instance), urtmapdownloads, etc.


you are definitely doing something wrong.
you only need 2 tables - one for the maps one for user feedback.
urtmaplicenses? dont know about overengineering but you are overdoing something :)
"It is the first responsibility of every citizen to question authority."
-- Benjamin Franklin
User avatar
havoc
Godlike
 
Posts: 674
Joined: 06.26.09

Re: New Maps for the mapcyclevote

Postby Pirat » 02.22.12

havoc wrote:
Pirat wrote:
havoc wrote:just add a table for comments with these columns:

comment id
map id
date/time
user id/name/whatever
comment text
type of comment

with type of comment being one of 3 - a pro, a con, or just comment
[...]
p.s. your primary in the maps table should be the map id

AFAIK, this won't work [...]

i think you are confused or something m8...

I always am, but your description was simply ambiguous.

havoc wrote:in your table the primary must be the map id, in my table the primary must be the comment id, with map id marking which comment is related to which map.

Aaaah, okay, so you mean this:

  • table "urtmaps":
    non-list map data (map id, filesize, ...), PK: map id
  • table "urtmapdata":
    each row is a comment with the fields you mentioned, PK: comment id.

Was that your suggestion? If no, please explain in detail.
If yes: hooray, no misunderstandings anymore! :-)

.
Pirat
Godlike
 
Posts: 1447
Joined: 03.29.10
-----tdm:  
nick: Pirat
skill: 507.365
kills: 402
deaths: 636
ratio: 0.63

Re: New Maps for the mapcyclevote

Postby havoc » 02.22.12

ok will try to explain. first of all heres a screenie so we all see what we talking about:

Screenshot-1.png


so given thats the supposed final result, how that translates into db? here goes:

map id - int, pk, a.i. - first we need this, a unique marker for every record (map) in the table
map name - varchar, the name of the map, like "Slumwar"
map file name - varchar, ut4_slumwar.pk3
map image - varchar, a screenie for the map
map modes - varchar, you will keep here a serialized array of the selected modes (see serialize in php docs). think of checkboxes
map size - varchar
file size - varchar, you can get that while uploading
author - varchar, you can make an ajax dropdown google suggestions style for easier data entering. oops - forgot - no ajax.
download - varchar, you can put a textarea and parse every url to a "Site1", "Site2" and such. tho id suggest theres only one download link and it points to a file somewhere on dswp. theres nothing as annoying as dead links.
home - varchar, input type = text
license - text - not sure you really need comments on the license there. better off without them
comments on tdm ffa and such - not sure you need that, it bloats the structure and gives you nothing. better off without them too.
pros, cons and notes - the user comments, will go to the other table

one more thing:
date added - a datetime, autodate for when this map is added

thats pretty much the map table columns
the comments table i pretty much already explained, nothing to add there really
You do not have the required permissions to view the files attached to this post.
"It is the first responsibility of every citizen to question authority."
-- Benjamin Franklin
User avatar
havoc
Godlike
 
Posts: 674
Joined: 06.26.09

Re: New Maps for the mapcyclevote

Postby havoc » 02.22.12

so ye, with both those tables, its kinda everything you need, + some php magic.
the rest is include the necessary phpbb files, and get the user session data, so you can check if they are logged and able to comment etc, and add automagically their name to their comment. and thats it - the map thing is ready.
"It is the first responsibility of every citizen to question authority."
-- Benjamin Franklin
User avatar
havoc
Godlike
 
Posts: 674
Joined: 06.26.09

Re: New Maps for the mapcyclevote

Postby wurst » 02.24.12

including phpbb means hooking it in template.

check 1.) ./whoswhere.php
its calling 2.) ./styles/blackbox_blue/template/whoswhere.html
there inside u find some

<!-- PHP --> include("http://www.dswp.de/old/dswp_tools/svarox/whoswhere_session.php"); <!-- ENDPHP -->

thats it, ure hooked.
check other files in template dir, maybe sort by chaned date to see the last trys...
eg. in xlr_stats.html u can see blinky passing GET variables.
its not elegant and its doing double stats.
its however working pretty ok, maybe u have a better way.

ah, ask xtj for anything with phpbb if google dont know the answer...
Image
User avatar
wurst
Godlike
 
Posts: 4648
Joined: 07.15.08
Location: Behind U
-----tdm:  
nick: [dswp]GewitterOma
skill: 1122.83
kills: 25960
deaths: 19847
ratio: 1.30
-----bomb:  
nick: [dswp]GewitterOma
skill: 812.172
kills: 3885
deaths: 3541
ratio: 1.09

Re: New Maps for the mapcyclevote

Postby havoc » 02.24.12

for a beginning he only needs to check if the user is logged, i.e. include the common includees and see the session stuff.

http://www.phpbb.com/kb/article/phpbb3- ... tegration/

this one is short and to the point.

Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>

Your existing page goes here


Code: Select all
<?php
if ($user->data['user_id'] == ANONYMOUS)
{
   echo 'Please login!';
}

else
{
   echo 'Thanks for logging in, ' . $user->data['username_clean'];
}
?>
"It is the first responsibility of every citizen to question authority."
-- Benjamin Franklin
User avatar
havoc
Godlike
 
Posts: 674
Joined: 06.26.09

Re: New Maps for the mapcyclevote

Postby havoc » 03.01.12

i think pirat left us for good
"It is the first responsibility of every citizen to question authority."
-- Benjamin Franklin
User avatar
havoc
Godlike
 
Posts: 674
Joined: 06.26.09

Re: New Maps for the mapcyclevote

Postby Pirat » 03.03.12

havoc wrote:i think pirat left us for good

Nooooooooooooo! If I would, you would read in the news about it. ;-}

Sorry for my seeming procrastination, but I was (and to some extent, still am) quite
busy with my job and other things.

Will take care of it soon, promised!
Pirat
Godlike
 
Posts: 1447
Joined: 03.29.10
-----tdm:  
nick: Pirat
skill: 507.365
kills: 402
deaths: 636
ratio: 0.63

PreviousNext

Who is online

Users browsing this forum: No registered users and 5 guests

Misc