Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2017-01-27 11:50:22

andacar
Member
From: Albuquerque, NM
Registered: 2014-09-03
Posts: 159
Website

php error while adding Matt's example for social media icons

Argh! Sorry to keep bothering you guys. I'm trying to implement Matt's example for adding social media icons to the footer of my Backlight page. When I load the page I get the following error:

Something went wrong
Unexpected error: Cannot redeclare ttg_user_load() (previously declared in /hermes/walnaweb06a/b2683/moo.gothic1/creepyhouse/backlight/custom/phplugins/creepyhouse.php:10) in creepyhouse.php on line 108

Here's the php script I'm using:

<?php

function ttg_user_load( $style, $path ) {
	$g_tsvrl = explode( ' ', $style );                          // Extract gallery type
	define ( 'G_STYLE', strtoupper($g_tsvrl[1]) );              // and set global for later
	$g_path = str_ireplace('\\','/',$path);                     // change \ to / 
	$chunks = explode('/',$g_path);                             // and put into array
	define ( 'G_PATH', strtoupper($chunks[count($chunks)-2]) ); // gallery folder name is second to last
	//define ( 'TTG_SITE', '');                                   // set new site root for navigation, resources, etc.
	}



function ttg_scripts( $style, $path ) { 
	echo '

	<script>var __adobewebfontsappname__="dreamweaver"</script>
<script src="http://use.edgefonts.net/metamorphous:n4:default.js" type="text/javascript"></script>

	';
	return false;
} // END

function ttg_footer_top( $style, $path ) { 
    echo '
<div class="custom_footer">
<div class="content clearfix">

    <p style="margin-bottom:0;"></p>

    <div class="grid_12">

        <div class="col_9 alpha">

            <p></p>

            <p>

                <a target="_blank" href="https://www.facebook.com/SirAndacar/"><span><img src="http://creepyhouse.net/images/icon-facebook.png" width="40" height="40" alt=""/></span></a>

                <a target="_blank" href="https://www.linkedin.com/in/darrell-leland-2a8bb616"><span><img src="http://creepyhouse.net/images/icon-linkedin.png" width="40" height="40" alt=""/></span></a>

            </p>

        </div>   
    </div><!-- .grid_12 --> 

</div>
</div><!-- .my_footer -->
    ';
    return true;
} // END
________________________________________



} // END




// ****************************************************************************************************
// END USER FUNCTIONS

?>

Thanks in advance,

Darrell Leland


Darrell Leland

"Never go creeping around old castles at night; you may find what you're looking for."
- Grimsley

Offline

#2 2017-01-27 11:54:45

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: php error while adding Matt's example for social media icons

That error seems to imply that ttg_user_load is being used more than once. Can you post the text of the entire file?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2017-01-27 13:06:38

andacar
Member
From: Albuquerque, NM
Registered: 2014-09-03
Posts: 159
Website

Re: php error while adding Matt's example for social media icons

Looks like you were right again! It was; when I copied and pasted I inadvertently left the old  ttg_user_load in and added a second. I also had to fix some syntax errors.

Thanks again!

Darrell Leland


Darrell Leland

"Never go creeping around old castles at night; you may find what you're looking for."
- Grimsley

Offline

#4 2017-02-01 04:30:05

michilge
Member
From: Sprockhövel, Germany
Registered: 2013-04-15
Posts: 206
Website

Re: php error while adding Matt's example for social media icons

@Rod:
May I ask how you implemented the social media share buttons under each post in your blog?
Did you use phplugins or are they managed by a wordpress plugin?

I have tried some wp plugins already, but many of them bring lots of ballast. And what I don't like about some is that some of them embed icons and or other elements from external adresses where my visitors get tracked even if they don't click the buttons at all.

In my eyes the way you have solved it appears the fairest possible solution towards visitors.

Offline

#5 2017-02-01 07:51:32

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: php error while adding Matt's example for social media icons

my main site (including my blog) is still a CE4 site (I know, I know....I need to get around to changing it to Backlight). Social media profiles and sharing are included in CE4.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#6 2017-02-02 03:42:07

charlie.choc
Member
From: Marietta, GA
Registered: 2014-01-09
Posts: 359
Website

Re: php error while adding Matt's example for social media icons

I wish those features had been carried forward, especially for those of us whose php and css skills are clumsy on our best days. ;-)

Offline

#7 2017-02-02 18:15:20

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: php error while adding Matt's example for social media icons

I may be adding social media icon support in the 1.2 update.


Matt

The Turning Gate, http://theturninggate.net

Offline

#8 2017-02-02 22:51:20

charlie.choc
Member
From: Marietta, GA
Registered: 2014-01-09
Posts: 359
Website

Re: php error while adding Matt's example for social media icons

That would be excellent!

Offline

#9 2017-02-04 00:10:06

michilge
Member
From: Sprockhövel, Germany
Registered: 2013-04-15
Posts: 206
Website

Re: php error while adding Matt's example for social media icons

charlie.choc wrote:

That would be excellent!

Could that also be adressed by a child theme?
Or by a PHPlugin-Hook in the WP-post?

I read Matt's thoughts about social media icons and understood that the decision, which platforms to include and which not may develop into further discussions.

I believe, Wordpress has constants for the URL of each posts that might be used to build  sharing links.
It might be an open approach that can be adapted by those who feel the need to integrate future platforms.

There might also exist a Wordpress plugin that can be recommended for creation of sharing links. But the ones I tried out so far all route some traffic to external servers to fetch a button from facebook or elswhere and thus track my visitors.

Anyway, I also would like to have sharing links on my blog posts as I had with CE4.

Offline

#10 2017-02-04 00:22:42

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: php error while adding Matt's example for social media icons

If you only need the sharing in blog posts, you might be able to find a lightweight, unobtrusive plug-in for that.

You can already easily include social media profile links just about anywhere on a Backlight page by just using html.

In this page I've added profile icons/links in both the navigation and the footer: http://backlight-rb-test.barbeephoto.co … e-turbines with just html entered in the content areas (for navigation, it's just a matter of using the Font Awesome code in the Name field and your social media URL in the URL field)

Sharing links/icons are tougher I don't see how to add those with plain html.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#11 2017-02-04 02:01:57

michilge
Member
From: Sprockhövel, Germany
Registered: 2013-04-15
Posts: 206
Website

Re: php error while adding Matt's example for social media icons

It is the sharing links in blog posts I'm missing.

I don't even have a facebook profile myself. But most of my visitors do. As I do sports photos for a regional team, the majority of my visitors are a rather homogenous crowd of mostly but not exclusively local people who like to inform each other via facebook.
After every match I upload a publisher based gallery and write a blog posts with some words on the game and link to the gallery from there. But the blog is the hub of my site.

When my site was CE4 based I had around 30% more visits with facebook as a referrer than today.

As soon as I find the time I will have a look at my child theme (with the author name/published date) wordpress has all kinds of constants If there is one for the author name and previous post, there will as well be one for the actual post as well. Should be possible to use one of those.

Last edited by michilge (2017-02-04 02:03:43)

Offline

#12 2017-02-04 02:29:48

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: php error while adding Matt's example for social media icons

A plug-in would be much easier, less time consuming, and easier on your hair. smile

This one is highly rated, has a lot of installs, and looks to be updated regularly
https://wordpress.org/plugins/social-media-feather/

but there are a bunch of others too.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#13 2017-02-04 02:37:10

michilge
Member
From: Sprockhövel, Germany
Registered: 2013-04-15
Posts: 206
Website

Re: php error while adding Matt's example for social media icons

That one in particular loads elements from their own servers to track my visitors. I don't want to loose the privacy concerned portion of my users for the benefit of those who like sharing.
The type of links created by CE4 were just links and thus the fairest way to offer sharing.

My hair has been gray for years anyway. :-)

edit:
I believe I did it.

Last edited by michilge (2017-02-07 07:10:56)

Offline

Board footer

Powered by FluxBB