Welcome, Guest. Please Login or Register.
May 04, 2025, 09:57:03 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Creating new table « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Creating new table  (Read 437 times)
Agelmar
YaBB God
*****
Posts: 931


Takako Matsu = Goddess

Creating new table
« on: March 29, 2002, 01:26:22 PM »
Reply with quote

Okay, I'm in the middle of writing a mod that allows users to upload avatars, rather than just storing a link to them. A user will be allowed to have one uploaded avatar at a time - if they switch to a default avatar / change their avatar their old one will be deleted.

ANYWAYS - I'm currently writing the mod for 1.3 (I might write it for 1.1 and 1.0 as well, but currently I'm trying to get it to work on 1.3). I just wanted to ask a protocol question here -

Is it OK to make a new table in which to store information? i.e. if I have in my mod.php file mysql_query("create table uavatarsmod (id int(11) primary key auto_increment, filename tinytext, owner tinytext)"); that shouldn't be a problem, should it? I just don't want to do anything that is taboo ^-^

-Agel
« Last Edit: March 29, 2002, 01:26:50 PM by Agelmar » Logged

TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:Creating new table
« Reply #1 on: March 29, 2002, 01:27:43 PM »
Reply with quote

Yes, read this:

http://www.yabb.info/community/index.php?board=134;action=display;threadid=4653
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:Creating new table
« Reply #2 on: March 29, 2002, 01:29:46 PM »
Reply with quote

ohh. do i win something for the speed of that reply?  ;D
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Agelmar
YaBB God
*****
Posts: 931


Takako Matsu = Goddess

Re:Creating new table
« Reply #3 on: March 29, 2002, 01:31:26 PM »
Reply with quote

No, you don't :P ^-^
Logged

Agelmar
YaBB God
*****
Posts: 931


Takako Matsu = Goddess

Re:Creating new table
« Reply #4 on: March 29, 2002, 01:34:05 PM »
Reply with quote

Mmm, thanks I forgot about dbprefix. But I don't need to use his file, do I? I mean, if I'm creating by hand, can't I just make a modname.php file and package it in, and then it will execute the code inside? Or is there a problem with that with which I am not aware?
Logged

TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:Creating new table
« Reply #5 on: March 29, 2002, 01:37:30 PM »
Reply with quote

Well thats for boardmod, but when I made my invisible login mod, he wanted me to call it dbmod.php. you'll have to talk to Godai about it i think.
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Agelmar
YaBB God
*****
Posts: 931


Takako Matsu = Goddess

Re:Creating new table
« Reply #6 on: March 29, 2002, 01:43:53 PM »
Reply with quote

OK, I did a report to moderator ^-^. I know that's not really the purpose of having the report to moderator feature, but Godai is the moderator, and he's the one who knows the answer, and it might help other people, SO....

^-^

(Also, do you think I should code it for 1.1 and 1.0 too, or just 1.3?)
Logged

TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:Creating new table
« Reply #7 on: March 29, 2002, 01:47:16 PM »
Reply with quote

1.3, Everyone will be using that, there will be no reason not to upgrade.
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Agelmar
YaBB God
*****
Posts: 931


Takako Matsu = Goddess

Re:Creating new table
« Reply #8 on: March 29, 2002, 01:53:43 PM »
Reply with quote

OK. I'm almost done writing the mod. I've already modded my 1.3b14 board and have it working, although I'm still trying to work out a few quirks. I.e. I'm trying to make things more efficient. Right now, when a user uploads a picture, it is assigned an ID number, the filename is stored, and the user who uploaded it is stored. I have modified the profile page further such that when the user or the admin modifies a person's profile, and they either upload a new picture or switch to a built in image, the user uploaded avatars table is searched, and if an entry for the user is found, it is deleted and the file is deleted as well. The problem is that it is not always necessary - i.e. if they switch from one built in to another, it will still do a mysql_query("select * from uavatarsmod where user={username}")... if it is an empty set it moves on, if not empty it will delete the entry and delete the file. I guess it's not too terrible... but it's the only way I can think of to do it.
Logged

Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:Creating new table
« Reply #9 on: March 29, 2002, 02:14:59 PM »
Reply with quote

you can use a script by you, but it's a good thing if we use the filename dbmod.php so we can have a standard :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Agelmar
YaBB God
*****
Posts: 931


Takako Matsu = Goddess

Re:Creating new table
« Reply #10 on: March 29, 2002, 04:24:03 PM »
Reply with quote

mmmf. Okay ^-^

I'm having fun now...
Logged

Dic
Noobie
*
Posts: 44


Re:Creating new table
« Reply #11 on: March 31, 2002, 04:12:32 AM »
Reply with quote

i already did this on my 1.1 board  ;D
let me know if you want the code to do it
i do have it controled from the admin center and it does check for auth
the only problem i have with mine is that it does nothing but redirect you back to the admin page when done it does not give you any kind of confirmation
Logged
szybszy
Noobie
*
Posts: 36


me not llama

Re:Creating new table
« Reply #12 on: April 01, 2002, 03:59:54 AM »
Reply with quote

Agelmar, will your mod support choosing Avatars from subdirectories under Avatars directory?

I it won't/doesn't do you know one that does?

Thanks!
Logged
Agelmar
YaBB God
*****
Posts: 931


Takako Matsu = Goddess

Re:Creating new table
« Reply #13 on: April 01, 2002, 10:03:50 PM »
Reply with quote

I suppose when I finish it I can add that in... it shouldn't be too bad... although the purpose of my mod was just to allow people to upload a single pic, not change the whole method..
Logged

AnalogDuck
Jr. Member
**
Posts: 54


I'm a Ducky! Quack quack...

ICQ - 131723443analogduck@hotmail.com WWW
Re:Creating new table
« Reply #14 on: July 15, 2002, 10:29:36 PM »
Reply with quote

So did this package ever get completed?  If so where can I find it?

Even if it didn't get completed, can I take a look at your work, so that I might complete it, or get some ideas to write my own mod with similar functionality?

Thanks in advance.  ;)
Logged

-- What does an "analog duck" sound like anyway?  That's the kind of noises I want to make... ;)
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Creating new table « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.055 seconds with 21 queries.