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 2014-10-02 01:14:06

kishw
Member
Registered: 2014-09-23
Posts: 38

Unwanted Text at bottom of Homepage

My home page www.kishwphotos.co.uk has some spurious unwanted text right at the bottom.
It appears to be part of the code I added to some of the files for disabling the context menu, but I cannot find where or how this text is being displayed on the home page, any ideas on which file I need to edit/find this text in ?

Regards
Kishw
London, UK

Offline

#2 2014-10-02 01:26:38

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

Re: Unwanted Text at bottom of Homepage

how did you add this code? It should be done via phplugins. The code needs to be added below the //SET USER FUNCTIONS BELOW notice


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 2014-10-02 03:48:28

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Unwanted Text at bottom of Homepage

Posting your phplugins.php code would help identifying the cause.


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#4 2014-10-02 03:54:05

kishw
Member
Registered: 2014-09-23
Posts: 38

Re: Unwanted Text at bottom of Homepage

after exporting the Pages I directly edited the files with notepad to paste in the code which was shown in your documentation. It took me a couple of attempts to get it to work as I didn't quite understand the instructions as where the code was to be inserted....

The problem seems to be this copy of part of the code has been pasted accidently into the wrong place within the homepage files, but I am unable to find out exactly which file and whereabouts this text is....

TIA
Kishw

Offline

#5 2014-10-02 04:31:24

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

Re: Unwanted Text at bottom of Homepage

It doesn't go in the index.php file. It goes in the phplugins file
refer to the phplugins documentation: http://ce4.theturninggate.net/docs/doku … _phplugins


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 2014-10-02 04:40:45

kishw
Member
Registered: 2014-09-23
Posts: 38

Re: Unwanted Text at bottom of Homepage

thanks for the quick response, think I have grasped that idea now, my original understanding was it needed to be added to the pages where it was to be used. I expect that by putting the code into the PHP plugins file it only needs to be entered once and will work across all pages in my website....and as such will remain intact even if CE4_pages are updated and uploaded to the server. However, this doesn't help find where the erroneous text that is being displayed at the bottom of my homepage is stored/being read from ??
Regards
Kishw

Offline

#7 2014-10-02 05:38:23

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

Re: Unwanted Text at bottom of Homepage

I expect that by putting the code into the PHP plugins file it only needs to be entered once and will work across all pages in my website....and as such will remain intact even if CE4_pages are updated and uploaded to the server

Yes. That's the great advantage of using phplugins, you can edit one file and have the changes propagated across the site, assuming you enable all your templates/indexes/galleries and enter the server path to the file.

However, this doesn't help find where the erroneous text that is being displayed at the bottom of my homepage is stored/being read from ??

It only appears to be on the index.php page so you could just take it out. Though it might be easier to just re-export and upload, it will overwrite whatever you did before.


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

Offline

#8 2014-10-03 01:08:12

kishw
Member
Registered: 2014-09-23
Posts: 38

Re: Unwanted Text at bottom of Homepage

I tried adding the code into phplugins file and removing from homepage file (index.php) - and it causes just a blank page to be dsiplayed instead of the website ?? deleting the code from phplugins and the website works okay - except I haven't go my right click context menu disabled on the home page. Php has been enabled in my pages and gallery files so I cannot see whats causing this behaviour ?

I know you are against disabling context menus and I partly inclined to agree with your comments except that for certain situations it would appear to be an easier option to implement than others.

Regards
Kish Woolmore

Offline

#9 2014-10-03 01:27:28

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

Re: Unwanted Text at bottom of Homepage

it causes just a blank page to be dsiplayed

when that happens it's usually due to a syntax error. What did you use to edit the phplugins file? It needs to be a plain text editor. Notepad++ for Windows is a great editor. Text Wrangler for Mac is supposed to be great too. (TextEdit on Mac causes some problems)

If that doesn't solve it, consider posting your phplugins file to the forum so someone can take a look.


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

Offline

#10 2014-10-03 07:19:05

kishw
Member
Registered: 2014-09-23
Posts: 38

Re: Unwanted Text at bottom of Homepage

I used windows notepad to edit the file, copied and pasted the code shown in your docs http://ce4.theturninggate.net/docs/doku … ntext_menu
The code works fine when pasted into the gallery template files
when it was pasted into homepage index.php file it worked as expected (ie blocked context menu) but it still displaying some of code at bottom of the page
You seem to have two different version of the code, one which gives a warning message (from http://ce4.theturninggate.net/docs/doku … text_menu) and the other code doesn't display any message on right click (from http://ce3wiki.theturninggate.net/doku. … ght-click)
the latter code works fine but the first option seems to have an error in the line that displays the warning message to the user

I think I have narrowed the fault down the 'Alert' line in the code from the ce4 wiki ?
further playing has helped - I have found that deleting the apostrophes from the Alert Text (in the ce4 code) enables it work - but I cannot see how this should make a difference when used the PHPLUGINS file when compared to the template-index.php files ??

regards
Kish Woolmore

Offline

#11 2014-10-03 07:29:06

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

Re: Unwanted Text at bottom of Homepage

phplugins are used to place code in your pages where Matt has supplied hooks. Those are the hook functions listed here:
http://ce4.theturninggate.net/docs/doku … _functions

You shouldn't be changing the index files exported from Lightroom as they'll just be overwritten the next time you export.

Looks like the difference between the two is just Matt having a bit of fun with it. The Alert looks correctly coded (unless the double quotes got messed with), but I'm not an expert at that.

As both I and Daniel have mentioned before, feel free to post the contents of your phplugins file here in the forum for someone to take a look at.


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

Offline

#12 2014-10-03 09:53:10

kmlucy
Member
From: Atlanta, GA
Registered: 2013-01-30
Posts: 123
Website

Re: Unwanted Text at bottom of Homepage

I had this problem as well. The file needs to be saved without a byte-order-mark. See the linked thread for details, but try using Notepad++ instead.
http://community.theturninggate.net/top … ge-broken/


Kyle Lucy Photography
kylelucy.com

Offline

#13 2014-10-03 18:08:20

kishw
Member
Registered: 2014-09-23
Posts: 38

Re: Unwanted Text at bottom of Homepage

SOLVED -

the Issue wasn't anything to do with byte-order-mark, thank you kmlucy though that did help show me something I didn't know about editing program files.

It appears the error is in the code, reading through PHPLUGINS file line by line, I noticed on line 26 that it states:

*    * or all single quotes must be escaped (ie \') or vice-versa                        *

So edited the code copied from the Wiki to put a "\" infront of the apostrophes (single quotes) in the alert statement, and now it works as expected.

Quite a simple solution really but surprised it didn't get mentioned previously.

Regards
Kish Woolmore
London, UK
www.kishwphotos.co.uk

Offline

#14 2014-10-03 20:44:43

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

Re: Unwanted Text at bottom of Homepage

So edited the code copied from the Wiki to put a "\" infront of the apostrophes (single quotes) in the alert statement, and now it works as expected.

That's probably why the alert statement in the tutorial uses quote marks (") rather than apostrophes (')


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

Offline

Board footer

Powered by FluxBB