Advertisement:

Author Topic: MyStatus Update Mod (beta) - a social network extension for SMF 2.0  (Read 33774 times)

Offline sangwe11

  • Full Member
  • ***
  • Posts: 680
  • The Pirate, Arrr!
    • sangwe11's Code Dump
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #80 on: November 14, 2009, 12:35:53 PM »
Huzzaaahhhh !!

About time too xD

Offline ElectricSquid

  • Full Member
  • ***
  • Posts: 498
  • Gender: Male
  • Forging a forum with blood, sweat, and steel
    • RedneckFabrication.com ...rebuilding the world with Scrap Steel, Duct Tape, & Bailing Wire
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #81 on: November 14, 2009, 04:09:37 PM »
I'm about half way through converting this mod over to it's own tables.
I might get it done tonight if all goes well.

While I'm at it, I'm taking the time to take the admin settings out of the language file and add them to  $modSettings. This was intended from the start, but I had other stuff that was more inportant that needed to be taken care of first.

Any suggestion on the data type the messages should be?

Offline sangwe11

  • Full Member
  • ***
  • Posts: 680
  • The Pirate, Arrr!
    • sangwe11's Code Dump
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #82 on: November 14, 2009, 04:12:48 PM »
Depends how long they are gunna be xD

Also, are you adding BBC buttons to the message boxes ?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #83 on: November 14, 2009, 04:14:12 PM »
It does, very much, depend on how long they are going to be.

If you keep it to 255 characters, you can do it in a varchar(255) which will keep performance well, but any longer than that, you'll need to use text.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline sangwe11

  • Full Member
  • ***
  • Posts: 680
  • The Pirate, Arrr!
    • sangwe11's Code Dump
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #84 on: November 14, 2009, 04:16:20 PM »
It does, very much, depend on how long they are going to be.

If you keep it to 255 characters, you can do it in a varchar(255) which will keep performance well, but any longer than that, you'll need to use text.

If any sad act wants to type more than 255 characters about what they're doing, faeking let em have the bad performance xD :D

Offline ElectricSquid

  • Full Member
  • ***
  • Posts: 498
  • Gender: Male
  • Forging a forum with blood, sweat, and steel
    • RedneckFabrication.com ...rebuilding the world with Scrap Steel, Duct Tape, & Bailing Wire
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #85 on: November 14, 2009, 04:18:09 PM »
255 is too small, have you see the length of some of the political conversations on facebook lately? 420 doesn't even cover it.

...and BBcode buttons will be eventually added so I should support those from the start.

Offline sangwe11

  • Full Member
  • ***
  • Posts: 680
  • The Pirate, Arrr!
    • sangwe11's Code Dump
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #86 on: November 14, 2009, 04:21:39 PM »
Then text is the only type you can use

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #87 on: November 14, 2009, 04:28:23 PM »
Then text is the only type you can use

Not strictly true. Varchar does support > 255 characters, however that's only on MySQL 5 and up. AFAIK the majority of SMF users aren't on MySQL 5+ yet.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline sangwe11

  • Full Member
  • ***
  • Posts: 680
  • The Pirate, Arrr!
    • sangwe11's Code Dump
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #88 on: November 14, 2009, 04:33:13 PM »
Then text is the only type you can use

Not strictly true. Varchar does support > 255 characters, however that's only on MySQL 5 and up. AFAIK the majority of SMF users aren't on MySQL 5+ yet.

Hense why I said text is the way too go xD

Offline ElectricSquid

  • Full Member
  • ***
  • Posts: 498
  • Gender: Male
  • Forging a forum with blood, sweat, and steel
    • RedneckFabrication.com ...rebuilding the world with Scrap Steel, Duct Tape, & Bailing Wire
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #89 on: November 14, 2009, 04:49:05 PM »
text or mediumtext?
SMF's message body uses mediumtext.
It there an advantage of using one over the other?

Quote
Not strictly true. Varchar does support > 255 characters, however that's only on MySQL 5 and up. AFAIK the majority of SMF users aren't on MySQL 5+ yet.

I have to keep this backward compatible. A lot of users can't control the database version they are on since they run through a host.

Offline ElectricSquid

  • Full Member
  • ***
  • Posts: 498
  • Gender: Male
  • Forging a forum with blood, sweat, and steel
    • RedneckFabrication.com ...rebuilding the world with Scrap Steel, Duct Tape, & Bailing Wire
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #90 on: November 14, 2009, 04:51:59 PM »
This answered the question for me...
http://www.ispirer.com/doc/sqlways39/Output/SQLWays-1-211.html

text it is.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #91 on: November 14, 2009, 04:52:49 PM »
In MySQL, TEXT and MEDIUMTEXT are exactly the same thing. MEDIUMTEXT is the technical name, TEXT the canonical.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline ElectricSquid

  • Full Member
  • ***
  • Posts: 498
  • Gender: Male
  • Forging a forum with blood, sweat, and steel
    • RedneckFabrication.com ...rebuilding the world with Scrap Steel, Duct Tape, & Bailing Wire
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #92 on: November 14, 2009, 05:52:33 PM »
Text could still be limited if I am understanding this correctly?
By adding a size to the row during creation?
Example below limits to 420?

And if this is so, how do I pass that info back to the user if the user types more than 420?

Code: [Select]
<?php

array(
'name' => 'body',
'type' => 'mediumtext',
'size' => '420',
'default' => null,
),

?>


Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #93 on: November 14, 2009, 05:57:53 PM »
That won't work properly and will not actually create the column (or table) for you.

TEXT and MEDIUMTEXT do not have implicit sizes less than 65535 characters.

You will have to check it yourself when the user submits it before attempting to add it to the database, and revert to the user appropriately.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Re:
« Reply #94 on: November 14, 2009, 07:00:40 PM »
Well I think that 255 characters are enough!! It's only a status update..!

Anyway I'm glad to read you've decided to use another table!! :)
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #95 on: November 14, 2009, 07:17:15 PM »
While I personally would agree (255 is fine for most users!) I can see the benefit of allowing the mod not to.

Idea for you: allow the user to switch it, and issue the appropriate db_alter_column statement.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline ElectricSquid

  • Full Member
  • ***
  • Posts: 498
  • Gender: Male
  • Forging a forum with blood, sweat, and steel
    • RedneckFabrication.com ...rebuilding the world with Scrap Steel, Duct Tape, & Bailing Wire
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #96 on: November 15, 2009, 11:18:08 AM »
db_alter_column statement.

Where's the documentation on that?
I'm not seeing it here [LINK]

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #97 on: November 15, 2009, 11:25:06 AM »
Oh, it's called db_change_column. I don't use it much to be honest so I wasn't 100% on what it was called.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline ormuz

  • Full Member
  • ***
  • Posts: 689
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #98 on: November 15, 2009, 12:14:01 PM »
Is there a demo?

Offline sangwe11

  • Full Member
  • ***
  • Posts: 680
  • The Pirate, Arrr!
    • sangwe11's Code Dump
Re: MyStatus Update Mod (beta) - a social network extension for SMF 2.0
« Reply #99 on: November 15, 2009, 12:35:56 PM »
Is there a demo?

Not afaik, but if he wants me too, I can set him up a demo if needs be.