Jump to content
TNG Community
mcm

Template 21 Random Photo

Recommended Posts

mcm

I recently upgraded to TNG 13.1.2, and I'd like to use template 21.

On the right side of the home/index page, under "Meet Our Family," there is supposed to be a random photo displayed. However, on my page, nothing displays. This is the code that is included in template 21's index.php file:

<?php
        $rp_maxwidth = "90%";
        include("randomphoto.php"); ?>

Am I supposed to edit or add something? 

Share this post


Link to post
Share on other sites
stores

You might try downloading the full tng v13.1.2 program and replace your randomphoto.php with the one in the download as the randomphoto.php is dated 1 May 2022 meaning it was changed after the 16 April 2022 release of TNG v13.1.2 so perhaps the issue was fixed...

Share this post


Link to post
Share on other sites
mcm

Thank you for the suggestion. Unfortunately, it does not fix the issue, randomphoto still not working for me with template 21.

Share this post


Link to post
Share on other sites
Michel KIRSCH

3 dummy questions :

Do you have any pictures in your TNG installation?
Are they pictures of deceased people?
If not, are you allowed to see photos of living people (as Admin, normally yes)

I try the template 21 (on my TNG 13.1.2) and all works fine...

Michel

Share this post


Link to post
Share on other sites
mcm

Michel, Thank you for your suggestion. The answer to all three questions is "Yes."

Your questions prompted me to back to template 16, which I had been using for several years, and with no problem at all with randomphoto. But I now see that randomphoto no longer works for me with template 16.

So: this is not an issue with Template 21 (I apologize for putting my query in the wrong section of the forum). It seems that my randomphoto is not working at all anymore, presumably since the latest upgrade. I wonder if I have an obsolete file that is interfering with randomphoto.php? 

Share this post


Link to post
Share on other sites
bhemph

What version of TNG did you upgrade from?  Do you have a TNG 13.0.0 - 13.1.1 zip file downloaded that you could restore the old version of the randomphoto.php file from?  If you can restore the previous version and randomphoto works, but the TNG 13.1.2 version does not, then it is something in the recent changes that broke it.

Share this post


Link to post
Share on other sites
Ken Roy

Best I can tell the randomphoto.php dated 1 May 2022 fixes the PHP warnings that were being issued if the photo collection is not found.  Unfortunately it now provides no indication that a photo should have been displayed in Template 20 (the change is not template specific)

In rebuilding a local web server on my desktop that had been neglected for over 3 years since I was mainly using my laptop for testing,  I tried the 1 May 2022 version of randomphoto.php that was added to the full install after TNG 13.1.2 was released and where previously I was getting a border in Template 20 where the random photo should have been and at the same time wrote PHP warnings to the php_error.log, with the new module completely suppressed the randompho div until I restored my media tables.

You might possibly have media tables out of sync from what TNG 13.1.2 is expecting.   As Brent asked above, what version of TNG did you upgrade from?  Did you run the database update step as part of the upgrade.

Share this post


Link to post
Share on other sites
mcm

I upgraded from 12. I'm pretty sure I ran the database upgrade. Should I try to run it again?

Thank you for your help.

Share this post


Link to post
Share on other sites
Ken Roy

Make sure you uploaded all the files in the js folder.

You also need to do forced reloads or clear cache for any changes in js or css files.

I am not familiar with Template 21.  What photo is supposed to changed when your reload the page?

Share this post


Link to post
Share on other sites
mcm
6 hours ago, Ken Roy said:

I am not familiar with Template 21.  What photo is supposed to changed when your reload the page?

On the default template, it is a photo under the heading "Meet Our Family," on the right-hand side of the page. 

At my site, I have changed that heading to "Photo Album," and for now, I have replaced the randomphoto code with a static photo which links to my photo album.

Share this post


Link to post
Share on other sites
Michel KIRSCH

Maybe (i say again : maybe) is it a bug in the code that your

server does not interpret correctly:

in the randomphoto.php file, change this line (line 52) :

    $photoinfo = @GetImageSize( "$rootpath$usefolder/" . $imgrow['path'] );

in

    $photoinfo = @getimagesize( "$rootpath$usefolder/" . $imgrow['path'] );

GetImageSize must be all lowercases...

Try it.

Michel

 

Share this post


Link to post
Share on other sites
andyfoot

I had the same problem, these images were not showing no matter what template I selected. And they used to work just fine.

With a bit of trial and error I found a solution, and as is often the case it's just a matter of ticking a box!

Media >> Edit Existing Media look at Media Information. 

Underneath "Cemetery" there are three check boxes. Mine were all unchecked. Check the "always viewable" box and hey presto, the images checked appear in the slideshow!

I guess this must have happened in the last update as it all worked just fine before!

 

Share this post


Link to post
Share on other sites
Ken Roy

Marking media as always viewable should NOT required for the random photo to work correctly. 

Something has changed in TNG 13.1.2 that is causing an issue in creating a new sandbox.  Darrin indicated no one else has complained of the problem with the randomphoto.php change.  He does not monitor the forum, so you all need to report this problem to Darrin.

Share this post


Link to post
Share on other sites
stores

My 2 cents... I use the randomphoto.php file to display headstones on my offline site and it works fine, displaying a different headstone every time the page is loaded. I use template 4.

Share this post


Link to post
Share on other sites
edglimited
On 5/7/2022 at 3:57 AM, mcm said:

Michel, Thank you for your suggestion. The answer to all three questions is "Yes."

Your questions prompted me to back to template 16, which I had been using for several years, and with no problem at all with randomphoto. But I now see that randomphoto no longer works for me with template 16.

So: this is not an issue with Template 21 (I apologize for putting my query in the wrong section of the forum). It seems that my randomphoto is not working at all anymore, presumably since the latest upgrade. I wonder if I have an obsolete file that is interfering with randomphoto.php? 

This is purely a suggestion. Have you tried viewing Template 21 in another Browser. ie; Chrome, Firefox, Opera etc..???

I can view you're website quite easily via Firefox.!!! Random photo works well.

Drew..

Share this post


Link to post
Share on other sites
RickM

@mcm

Having a look under the bonnet so to speak, it appears you may have made some changes to the randomphoto.php file

This is from my virgin template tng local install using template 21

random-1.jpg

This is from your site

random-2.jpg

If the randomphoto.php file is the latest version, then it is possible you have edited the template 21 index.php file?? Might pay to replace that with a virgin copy from freah tng install package for your TNG installed version.

If you would like further help PM me..

 

Share this post


Link to post
Share on other sites
mcm
On 5/13/2022 at 7:18 AM, RickM said:

@mcm

Having a look under the bonnet so to speak, it appears you may have made some changes to the randomphoto.php file

 

 

Thanks! Yes, I have deliberately replaced randomphoto.php with a static link to my photos. It was driving me nuts to have the randomphoto section just come up blank.

I made a mistake in posting this as a problem with template 21. Since I upgraded to TNG 13.1.2, randomphoto.php does not work for me at all, no matter which template I use. I had previously been using template 16 with TNG version 12, and randomphoto.photo had worked just fine.

Ken Roy is right that I need to contact Darrin about this. 

Share this post


Link to post
Share on other sites
edglimited
21 minutes ago, mcm said:

Thanks! Yes, I have deliberately replaced randomphoto.php with a static link to my photos. It was driving me nuts to have the randomphoto section just come up blank.

I made a mistake in posting this as a problem with template 21. Since I upgraded to TNG 13.1.2, randomphoto.php does not work for me at all, no matter which template I use. I had previously been using template 16 with TNG version 12, and randomphoto.photo had worked just fine.

Ken Roy is right that I need to contact Darrin about this. 

So, would I be correct in saying, you have solved the problem and are currently back using Template 21..!!!

The 1st pic, is what Template 21 looks like in raw form. The 2nd, is your Website about 3 minutes ago. The 3rd, is about 2 minutes ago. So going by those shots, randomphoto.php works...

Which begs the question, what have you changed...????

 

template 21.png

Screenshot from 2022-05-15 12:27:54.png

Screenshot from 2022-05-15 12:28:14.png

Share this post


Link to post
Share on other sites
mcm

I'm still using template 21. But those different pics on my front page are part of a slideshow that is specific to template 21, and separate from the randomphoto.php call.

I have not yet solved my randomphoto.php problem. 

Share this post


Link to post
Share on other sites
edglimited
34 minutes ago, mcm said:

I'm still using template 21. But those different pics on my front page are part of a slideshow that is specific to template 21, and separate from the randomphoto.php call.

I have not yet solved my randomphoto.php problem. 

I get what you are saying, in that they are specific to Template 21. However, as a workaround, you could replace the photos within that slideshow, with random photos of your own..

Share this post


Link to post
Share on other sites
rami1
On 5/5/2022 at 4:36 PM, mcm said:

I recently upgraded to TNG 13.1.2, and I'd like to use template 21.

On the right side of the home/index page, under "Meet Our Family," there is supposed to be a random photo displayed. However, on my page, nothing displays. This is the code that is included in template 21's index.php file:

<?php
        $rp_maxwidth = "90%";
        include("randomphoto.php"); ?>

Am I supposed to edit or add something? 

hi 

you don't need to change any think from coding you only need to replace exiting photo from template setting itself from admin area Setup >> Configuration >> Template Settings

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×