[ADB] Social Networking Site Buttons 2.1.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
mreider
Registered User
Posts: 98
Joined: Fri Sep 19, 2003 9:30 pm

Re: Social Networking Site profiles

Post by mreider »

lol thanks for the response.

One issue I'm having now - WHen I enter in my twitter username, and hit submit, I get an error saying "WRONG_DATA"

I found it's because I was putting in my username, and not www.twitter.com/username

I'm thinking I'll put a guide like 'Please enter www.twitter.com/username" or maybe even prefill that page with www.twitter.com/
User avatar
KellyBean
Registered User
Posts: 270
Joined: Wed Nov 07, 2007 3:06 pm
Location: Massachusetts
Contact:

Re: Social Networking Site profiles

Post by KellyBean »

Edit: I see what you're talking about now.

To fix that, in viewtopic_body.html,

Replace this:

Code: Select all

    <!-- IF postrow.U_TWITTER--><li class="twitter-icon"><a href="{postrow.U_TWITTER}" title="{L_TWITTER}"><span>{L_TWITTER}</span></a></li><!-- ENDIF -->
With this:

Code: Select all

    <!-- IF postrow.U_TWITTER--><li class="twitter-icon"><a href="http://twitter.com/{postrow.U_TWITTER}" title="{L_TWITTER}"><span>{L_TWITTER}</span></a></li><!-- ENDIF -->
Then all the member has to do is enter their username. :)
Last edited by KellyBean on Sun Mar 01, 2009 6:39 pm, edited 1 time in total.
My Forum | My Design/How-to Site
Need help MODing or customizing your site? I can do it for a very reasonable fee. Contact me!

Image
mreider
Registered User
Posts: 98
Joined: Fri Sep 19, 2003 9:30 pm

Re: Social Networking Site profiles

Post by mreider »

Nice I did the same for MySpace :)
User avatar
KellyBean
Registered User
Posts: 270
Joined: Wed Nov 07, 2007 3:06 pm
Location: Massachusetts
Contact:

Re: Social Networking Site profiles

Post by KellyBean »

I'll include that fix when I write this up in MODX. Thanks!
My Forum | My Design/How-to Site
Need help MODing or customizing your site? I can do it for a very reasonable fee. Contact me!

Image
mreider
Registered User
Posts: 98
Joined: Fri Sep 19, 2003 9:30 pm

Re: Social Networking Site profiles

Post by mreider »

I'm getting the "WRONG_DATA" error now because of not entering a URL now...Can we fix that? It has something to do with

Code: Select all

'myspace'      => array(
                     array('string', true, 12, 255),
                     array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),    
from ucp_profile
User avatar
KellyBean
Registered User
Posts: 270
Joined: Wed Nov 07, 2007 3:06 pm
Location: Massachusetts
Contact:

Re: Social Networking Site profiles

Post by KellyBean »

Good catch (again!) :D

Replace:

Code: Select all

'twitter'		=> array(
							array('string', true, 12, 255),
							array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
With:

Code: Select all

'twitter'   	=> array('string', true, 4, 15),
And oh, for that, you'll need to modify the sql a bit:

For Twitter and/or MySpace:

Code: Select all

ALTER TABLE phpbb_users ADD COLUMN user_twitter VARCHAR(15) NOT NULL DEFAULT '';
ALTER TABLE phpbb_users ADD COLUMN user_myspace VARCHAR(15) NOT NULL DEFAULT '';
Except I'm not quite sure that there's a set character min/max for MySpace usernames.... :? Anyone know?
My Forum | My Design/How-to Site
Need help MODing or customizing your site? I can do it for a very reasonable fee. Contact me!

Image
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17407
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Social Networking Site profiles

Post by DavidIQ »

I'd just stick with a VARCHAR(255). No use in limiting how many characters you can enter for the username via the database. ;)
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
RMcGirr83
Former Team Member
Posts: 21826
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Social Networking Site profiles

Post by RMcGirr83 »

DavidIQ wrote:I'd just stick with a VARCHAR(255). No use in limiting how many characters you can enter for the username via the database. ;)
Not when you can do it with the php code, eh David? ;)
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
User avatar
KellyBean
Registered User
Posts: 270
Joined: Wed Nov 07, 2007 3:06 pm
Location: Massachusetts
Contact:

Re: Social Networking Site profiles

Post by KellyBean »

Thanks. I'm new at all this stuff. :oops: :D
My Forum | My Design/How-to Site
Need help MODing or customizing your site? I can do it for a very reasonable fee. Contact me!

Image
DJ Skitzo
Registered User
Posts: 596
Joined: Sun Aug 12, 2007 7:25 pm

Re: Social Networking Site profiles

Post by DJ Skitzo »

Could you possible add a Bebo one to your collection aswell? Thanks
User avatar
KellyBean
Registered User
Posts: 270
Joined: Wed Nov 07, 2007 3:06 pm
Location: Massachusetts
Contact:

Re: Social Networking Site profiles

Post by KellyBean »

Sure! I'll make an icon tomorrow. :D
My Forum | My Design/How-to Site
Need help MODing or customizing your site? I can do it for a very reasonable fee. Contact me!

Image
DJ Skitzo
Registered User
Posts: 596
Joined: Sun Aug 12, 2007 7:25 pm

Re: Social Networking Site profiles

Post by DJ Skitzo »

KellyBean wrote:Sure! I'll make an icon tomorrow. :D
Thank you very much :D
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17407
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Social Networking Site profiles

Post by DavidIQ »

RMcGirr83 wrote:
DavidIQ wrote:I'd just stick with a VARCHAR(255). No use in limiting how many characters you can enter for the username via the database. ;)
Not when you can do it with the php code, eh David? ;)
Exactly :)
Making it VARCHAR(255) in the database means you don't have to worry about fitting enough characters in there... unless someone has a 255 character long username for a social networking site :shock:
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
KellyBean
Registered User
Posts: 270
Joined: Wed Nov 07, 2007 3:06 pm
Location: Massachusetts
Contact:

Re: Social Networking Site profiles

Post by KellyBean »

For Bebo:
Icon: Image

Code: Select all

    ##############################################################
    ## MOD Title: Add Bebo Icon In Viewtopic
    ## MOD Author: KellyBean
    ## MOD Description: Adds a Bebo link and icon to viewtopic.
    ##
    ## MOD Version: 0.0.1
    ##
    ## Installation Level: (Easy)
    ## Installation Time: 5 min
    ##
    ## Files To Edit: includes/ucp/ucp_profile.php
    ##          includes/acp/acp_styles.php
    ##          language/en/common.php
    ##          language/en/ucp.php
    ##          memberlist.php
    ##          viewtopic.php
    ##          styles/prosilver/imageset/imageset.cfg
    ##          styles/prosilver/theme/buttons.css
    ##          styles/prosilver/theme/colours.css
    ##          styles/prosilver/template/ucp_profile_profile_info.html
    ##          styles/prosilver/template/viewtopic_body.html
    ##
    ## Included Files: imageset/icon_contact_bebo.png
    ##
    ##############################################################


    #
    #-----[ SQL ]---------------------------------------------
    #

    ALTER TABLE `phpbb_users` ADD `user_bebo` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';

    #
    #-----[ COPY ]------------------------------------------
    #
    imageset/icon_contact_bebo.png       to   imageset/icon_contact_bebo.png

    #
    #-----[ OPEN ]---------------------------------------------
    #
    includes/ucp/ucp_profile.php

    #
    #-----[ FIND ]---------------------------------------------
    #
                $data = array(
                   'icq'         => request_var('icq', $user->data['user_icq']),
                   'aim'         => request_var('aim', $user->data['user_aim']),
                   'msn'         => request_var('msn', $user->data['user_msnm']),
                   'yim'         => request_var('yim', $user->data['user_yim']),
                   'jabber'      => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)),
                   'website'      => request_var('website', $user->data['user_website']),

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
                   'bebo'      => request_var('bebo', $user->data['user_bebo']),

    #
    #-----[ FIND ]---------------------------------------------
    #
                      'website'      => array(
                         array('string', true, 12, 255),
                         array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
                      'bebo'      => array('string', true, 4, 255),

    #
    #-----[ FIND ]---------------------------------------------
    #
                         'user_interests'=> $data['interests'],

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
                         'user_bebo'   => $data['bebo'],


    #
    #-----[ FIND ]---------------------------------------------
    #
                   'INTERESTS'   => $data['interests'],

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
                   'BEBO'   => $data['bebo'],

    #
    #-----[ OPEN ]---------------------------------------------
    #
    language/en/acp/styles.php

    #
    #-----[ FIND ]---------------------------------------------
    #
       'IMG_ICON_CONTACT_WWW'      => 'Website',

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
       'IMG_ICON_CONTACT_BEBO'      => 'Bebo',

    #
    #-----[ OPEN ]---------------------------------------------
    #
    includes/acp/acp_styles.php

    #
    #-----[ FIND ]---------------------------------------------
    #
             'buttons'   => array(
                'icon_back_top', 'icon_contact_aim', 'icon_contact_email', 'icon_contact_icq', 'icon_contact_jabber', 'icon_contact_msnm', 'icon_contact_pm', 'icon_contact_yahoo', 'icon_contact_www', 'icon_post_delete', 'icon_post_edit', 'icon_post_info', 'icon_post_quote', 'icon_post_report', 'icon_user_online', 'icon_user_offline', 'icon_user_profile', 'icon_user_search', 'icon_user_warn', 'button_pm_forward', 'button_pm_new', 'button_pm_reply', 'button_topic_locked', 'button_topic_new', 'button_topic_reply',
             ),

    #
    #-----[ IN_LINE FIND ]---------------------------------------------
    #
    'icon_contact_msnm'

    #
    #-----[ IN-LINE AFTER, ADD ]---------------------------------------------
    #
    , 'icon_contact_bebo'

    #
    #-----[ OPEN ]---------------------------------------------
    #
    language/en/common.php

    #
    #-----[ FIND ]---------------------------------------------
    #
       'GO'                  => 'Go',

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
       'BEBO'               => 'Bebo',

    #
    #-----[ OPEN ]---------------------------------------------
    #
    language/en/ucp.php

    #
    #-----[ FIND ]---------------------------------------------
    #
       'UCP_JABBER'            => 'Jabber address',

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
        'UCP_BEBO'            => 'Bebo Profile',

    #
    #-----[ OPEN ]---------------------------------------------
    #
    memberlist.php

    #
    #-----[ FIND ]---------------------------------------------
    # Around line 565
             'JABBER_IMG'   => $user->img('icon_contact_jabber', $user->lang['JABBER']),


    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
             'BEBO_IMG'   => $user->img('icon_contact_bebo', $user->lang['BEBO']),

    #
    #-----[ FIND ]---------------------------------------------
    # Around line 1492
             'JABBER_IMG'   => $user->img('icon_contact_jabber', $user->lang['JABBER']),


    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
             'BEBO_IMG'   => $user->img('icon_contact_bebo', $user->lang['BEBO']),

    #
    #-----[ OPEN ]---------------------------------------------
    #
    viewtopic.php

    #
    #-----[ FIND ]---------------------------------------------
    #
       'JABBER_IMG'      => $user->img('icon_contact_jabber', 'JABBER') ,


    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
       'BEBO_IMG'      => $user->img('icon_contact_bebo', 'BEBO'),

    #
    #-----[ FIND ]---------------------------------------------
    #
                'aim'            => '',
                'msn'            => '',
                'yim'            => '',

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
                'bebo'         => '',

    #
    #-----[ FIND ]---------------------------------------------
    #
                'jabber'      => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=jabber&u=$poster_id") : '',

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
                'bebo'      => $row['user_bebo'],

    #
    #-----[ FIND ]---------------------------------------------
    #
          'U_JABBER'      => $user_cache[$poster_id]['jabber'],

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
          'U_BEBO'   => $user_cache[$poster_id]['bebo'],

    #
    #-----[ OPEN ]---------------------------------------------
    #
    styles/prosilver/imageset/imageset.cfg

    #
    #-----[ FIND ]---------------------------------------------
    #
    img_icon_contact_msnm = icon_contact_msnm.gif*20*20

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
    img_icon_contact_bebo = icon_contact_bebo.png*20*20

    #
    #-----[ OPEN ]---------------------------------------------
    #
    styles/prosilver/theme/buttons.css

    #
    #-----[ FIND ]---------------------------------------------
    #
    .web-icon, .web-icon a         { background: none top left no-repeat; }

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
    .bebo-icon, .bebo-icon a   { background: none top left no-repeat; }

    #
    #-----[ FIND ]---------------------------------------------
    #
    ul.profile-icons li.web-icon   { width: {IMG_ICON_CONTACT_WWW_WIDTH}px; height: {IMG_ICON_CONTACT_WWW_HEIGHT}px; }

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
    ul.profile-icons li.bebo-icon   { width: {IMG_ICON_CONTACT_BEBO_WIDTH}px; height: {IMG_ICON_CONTACT_BEBO_HEIGHT}px; }

    #
    #-----[ OPEN ]---------------------------------------------
    #
    styles/prosilver/theme/colours.css

    #
    #-----[ FIND ]---------------------------------------------
    #
    .jabber-icon, .jabber-icon a      { background-image: url("{IMG_ICON_CONTACT_JABBER_SRC}"); }

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
    .bebo-icon, .bebo-icon a   { background-image: url("{IMG_ICON_CONTACT_BEBO_SRC}"); }

    #
    #-----[ OPEN ]---------------------------------------------
    #
    styles/prosilver/template/ucp_profile_profile_info.html

    #
    #-----[ FIND ]---------------------------------------------
    #
       <dl>
          <dt><label for="website">{L_WEBSITE}:</label></dt>
          <dd><input type="text" name="website" id="website" maxlength="255" value="{WEBSITE}" class="inputbox" /></dd>
       </dl>

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
       <dl>
          <dt><label for="bebo">{L_UCP_BEBO}:</label></dt>
          <dd><input type="text" name="bebo" id="bebo" maxlength="255" value="{BEBO}" class="inputbox" /></dd>
       </dl>

    #
    #-----[ OPEN ]---------------------------------------------
    #
    styles/prosilver/template/viewtopic_body.html

    #
    #-----[ FIND ]---------------------------------------------
    #
                   <!-- IF postrow.U_JABBER --><li class="jabber-icon"><a href="{postrow.U_JABBER}" onclick="popup(this.href, 550, 320); return false;" title="{L_JABBER}"><span>{L_JABBER}</span></a></li><!-- ENDIF -->

    #
    #-----[ AFTER, ADD ]--------------------------------------
    #
                   <!-- IF postrow.U_BEBO --><li class="bebo-icon"><a href="http://www.bebo.com/{postrow.U_BEBO}" target="_blank" title="{L_BEBO}"><span>{L_BEBO}</span></a></li><!-- ENDIF -->


    #
    #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
    #
    # EoM
Let me know how that works. :)
My Forum | My Design/How-to Site
Need help MODing or customizing your site? I can do it for a very reasonable fee. Contact me!

Image
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17407
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Social Networking Site profiles

Post by DavidIQ »

KellyBean:

Rename your topic according to this so I can move this to MODs in Development, where it should have been :)
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
Locked

Return to “[3.0.x] MODs in Development”