Social.php
This contains Wizard’s Toolkit functions involving social media.
These functions have not been tested since 2013. Need to review and verify.
All rights reserved.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Tags
Table of Contents
- wtkSocialSmartLayer() : null
- Add the 'AddThis' SmartLayers to your website
- wtkHtmShowTwitter() : string
- Add a Twitter Feed to the website
- wtkSocialFollowUs() : string
- Add the 'AddThis' Follow Us to your website
- wtkHtmShowSocial() : string
- Add the 'AddThis' small footprint sharing links widget to your website
Functions
wtkSocialSmartLayer()
Add the 'AddThis' SmartLayers to your website
wtkSocialSmartLayer(
string
$fncAddThisID
,
string
$fncFaceBookID
,
string
$fncTwitterID
) : null
Adds necessary Javascript to page just before
Parameters
- $fncAddThisID : string
-
is the AddThis unique identifier you get when signing up with their service
- $fncFaceBookID : string
-
the Facebook page link
- $fncTwitterID : string
-
the Twitter account ID
Return values
null —nothing returned because automatically adds JS to page before head
wtkHtmShowTwitter()
Add a Twitter Feed to the website
wtkHtmShowTwitter
(string
$fncTwitterAcct
,
string
$fncWidgetID
[,
int
$fncWidth =
'' ]
[,
int
$fncHeight =
''
]) :
string
Adds necessary Javascript to page just before
Parameters
- $fncTwitterAcct : string
-
the Twitter account ID
- $fncWidgetID : string
-
this has to be gotten from Twitter for this particular account
- $fncWidth : int = ''
-
optional way to pass width
- $fncHeight : int = ''
-
optional way to pass Height
Return values
string —the HTML that will contain the Twitter feed
wtkSocialFollowUs()
Add the 'AddThis' Follow Us to your website
wtkSocialFollowUs
(
string
$fncAddThisID
,
string
$fncFaceBookID
,
string
$fncTwitterID
) : string
Most of time should instead use wtkSocialSmartLayer above Adds necessary Javascript to page just before
Parameters
- $fncAddThisID : string
-
is the AddThis unique identifier you get when signing up with their service
- $fncFaceBookID : string
-
the Facebook page link
- $fncTwitterID : string
-
the Twitter account ID
Return values
string —the HTML that will contain the "Follow Us" code
wtkHtmShowSocial()
Add the 'AddThis' small footprint sharing links widget to your website
wtkHtmShowSocial(
string
$fncLocation)
: string
Most of time should instead use wtkSocialSmartLayer above instead Adds necessary Javascript to page just before
Displays Social Media bar (facebook, emailthis, del.icio.us, etc.) Specify 'top' and/or 'footer' (if you want it in both places) for $fncLocation variable.
Variables to add to the calling page for site specificity:
- Email subject and email body
- Facebook link
Add these images to the imgs/ folder off the root:
- delicious.gif
- emailthis.png
- googlesbm.png
Add these styles to the site's style sheet and adapt as needed:
.facebook_top { width: 215px; float: left; clear:both; font: 10px Verdana, Arial, Helvetica, sans-serif; margin: 10px 0 10px 0; text-align: left; }
.facebook_footer { font: 10px Verdana, Arial, Helvetica, sans-serif; margin: 10px 0 10px 0; text-align: left; display: inline;}
Example on how to call this function:
$pgEmailSubject = wtkHtmlEncode("My Wizard’s Toolkit Web Site");
$pgEmailBody = wtkHtmlEncode('I built this in less time than you would guess. Take a look!');
$pgFacebookURL = 'http://www.facebook.com/WizardsToolkit';
wtkSearchReplace("<!-- @Social@ -->", wtkHtmShowSocial('top', $pgEmailSubject, $pgEmailBody, $pgFacebookURL));
Parameters
- $fncLocation : string
-
'top' or 'footer' location
Return values
string —the HTML that will contain the widget code