Previous Thread
Next Thread
Print Thread
Rating: 10
Page 2 of 2 1 2
Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
Josh - in Classic, there's a little cake icon that shows next to the user's name in posts when it's their birthday. Is there any chance of getting that to work with this?

-peter

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Probably could. I'm not really doing any more development on this, as it's built into 6.4 (and the cake icon)

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
The cake icon is in 6.4? Wow, if so I'm impressed!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yup.

Check it out at http://www.joshuapettit.com

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK - if you have this installed - one query may fail when you run the 6.4 altertable. As w already have the U_BirthDay field - the query in 6.4 which adds U_Birthday conflicted on my tests.

Backup your database first! I developed this for my own needs so use at your own risk.

The attached file - download it and raname it from .txt to .php. Upload it to your ubbthreads directory.

Then AFTER you run your 6.4 altertable, run the convertbday.php script.

It will change the name of the old birtday field.... add the new fields (which may have failed with the 6.4 altertable) and convert all the previously entered birthdays with this mod to the new UBB.Threads version 6.4 birthday field.



After be sure to remove it from your server!
Attachments
96491-convertbday.txt (0 Bytes, 71 downloads)

Sponsored Links
Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
I did as you told, but it's not working....

After the 6.4 altertable, I run convertbday.php and here are some results:

[]// script to convert JoshPet's birthday mod dates to the 6.4 date format // Written by Joshua Pettit www.joshuapettit.com We need to rename the old field. You might get an error here, which is OK.

SQL ERROR: Wed, Dec 10 2003 18:10:35 -0600 Database error only visible to forum administrators
We need to create the new birthday fields - in case the 6.4 altertable couldn't do this at the time. You might get an error here too, which is OK.

SQL ERROR: Wed, Dec 10 2003 18:10:35 -0600 Database error only visible to forum administrators
Now we will cycle through the users and update their birthday information.

The User Pasqual - had 1-8-1974 for their birthday the new field was set to 1/8/1974
Marcela - No Birthday Information
The User Nicole - had 8-31-1977 for their birthday the new field was set to 8/31/1977
Yvonne - No Birthday Information
lamlam - No Birthday Information[/]

This seems to work fine, but as you can see in the attached picture, the U_Birthday field is not filled. How come ?

Which SQL command should I use to fill that columm ?

Thank you very much!

Pasquale
Attachments
101587-birthdays.jpg (0 Bytes, 26 downloads)

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
>> SQL ERROR: Wed, Dec 10 2003 18:10:35 -0600 Database error only visible to forum administrators
Probably would need to see the SQL Errors to see what's going wrong. They should be in your MySQL Error log - but looks like the script isn't being able to update the new field.

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
Josh, I've run your script once again and here's the SQL error I get:

[]Unable to do_query: ALTER TABLE w3t_Users CHANGE U_BirthDay U_BirthDayOLD INT( 2 ) UNSIGNED DEFAULT NULL - Duplicate column name 'U_BirthDayOLD' [/]
and
[]Unable to do_query: ALTER TABLE w3t_Users ADD U_Birthday VARCHAR(10) NOT NULL DEFAULT '0', ADD U_ShowBday INT(1) NOT NULL DEFAULT '0', ADD U_TimeFormat VARCHAR(6), ADD U_Ignored TEXT, ADD U_OC_Userid VARCHAR(64), ADD INDEX birthday_ndx (U_Birthday,U_ShowBday) - Duplicate column name 'U_Birthday'[/]

I think it shouldn't be hard to convert the three birthday fields into one using some query, but not for me

U_BirthMonth , U_BirthDayOLD and U_BirthYear should be combined into the new U_BirthDay format...

Thanks in advance!

Pasquale

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yeah, this is like an altertable, you can't run it more than once without causing troubles.

The errors you show now are because you already ran it. We still don't know what the real error was when you ran it the first time.

If you need to run it on a db that you already ran it on, you could try commenting out the two queries which alter the tables... the update part of the script should do the trick.

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
Ok, I commented out // Rename the old field
and // Add the 6.4 fields in case the query to add them failed.

It then seems the script does it's work, but it doesn't
I attached the results-page. I don't get any errors.

Attachments
104503-convertbday results.zip (0 Bytes, 7 downloads)

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Well you've still got errors there that you have not yet shared.

This query:
UPDATE {$config['tbprefix']}Users
SET U_Birthday = '$NewBday_q',
U_ShowBday = 1
WHERE U_Number = $Number


Should be executing.

You need to actually look at the error logs and see if there's a problem with that query.

You might try updating one manually to see if it produces an error.

Otherwise... I don't know.
Otherwise there's not much else information I can gather from anything posted here to try and help.

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
This is sooo weird
I tried it once again and I get no errors, but the birthday field doesn't get updated
I attached the script I've run and the result page I get.
Attachments
104507-convertbd.zip (0 Bytes, 2 downloads)

Joined: Nov 2003
Posts: 107
SisterKristi
SisterKristi
Joined: Nov 2003
Posts: 107
WOW, that's a lot of work guys, thankie.. Yup, I'm a Capricorn shhhhhhhh tee hee

Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
Joined: Mar 2003
Posts: 215
Main forum index page ends up with a query to match birthdays with no key index on any of the birthday fields added in this mod. Mysql ends up examining all w3t_User records. I noticed this when I did a debug=1 on the main forum index page.

(Saves a fraction of a second on page loads with an index added)

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
[]JoshPet said:
OK - if you have this installed - one query may fail when you run the 6.4 altertable. As w already have the U_BirthDay field - the query in 6.4 which adds U_Birthday conflicted on my tests.

Backup your database first! I developed this for my own needs so use at your own risk. <img src="/forum/images/graemlins/wink.gif" alt="" />

The attached file - download it and raname it from .txt to .php. Upload it to your ubbthreads directory.

Then AFTER you run your 6.4 altertable, run the convertbday.php script.

It will change the name of the old birtday field.... add the new fields (which may have failed with the 6.4 altertable) and convert all the previously entered birthdays with this mod to the new UBB.Threads version 6.4 birthday field. <img src="/forum/images/graemlins/smile.gif" alt="" />

<img src="/forum/images/graemlins/smile.gif" alt="" />

After be sure to remove it from your server! [/]

If you run this, whilst upgrading to 6.5 - you need to make sure that main.inc.php can be found, as this is moved to /includes/


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Page 2 of 2 1 2

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)