Pyro Cms Flicker Gallery add On(from Arthur guy) Not showing the complete photosets on Front end - add-on

I've PyroCMS project running on my intranet, and i have used the flicker gallery from https://arthurguy.co.uk/code/pyrocms-add-on-flickr-gallery
The Back end that is admin panel showing all the photo galleries (21), but the front end of site not showing the Last two added photo galleries.
contacted the author but he might not able to provide feed Back.

Going through this issue, it might looks like the cache problem as this addon use the cached result as well, so first try to change the cache length from the admin panel settings and check the results.
If the problem remains there the look into the front end controller flicker_gallery and check in the index function.
There is code snippent like this
if (! $photosets = $this->pyrocache->get('flickr_gallery_get_photosets'))
Just remove that not ! operator from the condition and check the results on front End. Then provide your response.

Related

How do Big sites prevent the loading circle on tabs from showing?

Okay I do not know how to explain this to you, It may be just my internet, or maybe my site is slower, or they really have a technique for doing this.
If you visit Facebook, Reddit, Youtube, Twitter, and if you click on links or any actions on those websites, the url changes but the browser tab doesn't show any loading circle.
How do they do that?
I am pretty sure my website is fast enought and at times it loads even faster than the bigger sites, but mine shows the loading circle on the browser tab.
Okay so I found the answer. Here is the technique for changing the url without reloading the page.
Updating address bar with new URL without hash or reloading the page
How do I modify the URL without reloading the page?
I am still trying to figure out though how to redirect the actual page without reloading the entire page. I am guessing they are loading it via ajax or something similar upon url change. I'll update this once I figure it out.
Edit: I am currently working on this feature for my site. The technique is to use ajax to load the content based on the url. I'll update this thread more as I update my site with this feature.
Edit 2: Damn, you will probably face the same problem I had trying to detect the url change without using onhashchange. If so, here you go:
How to detect URL change in JavaScript
This literally took me 4 hours just to figure that one out.....
Edit 3: I have now integrated this feature on my site. You can check it at
Grandweb
It is quite simple, but lots of work in appending the content once retrieved via ajax. So here is the process:
I am using pushState(); to change the url without reloading the page.
var url = $(this).attr('href');
var split_url = url.split('/');
var new_url = url.replace('https://grandweb.net/','');
window.history.pushState("object or string", "Title", "/write");
Using 'mouseup' was a bad idea, I changed my mind.
I then have to trigger the first function using 'mouseup' to retreieve the content via ajax, and then listen to succeeding onpopstate() for the next ones, because some mouse actions such as Mouse 4 or Mouse 5 are bound to the browser's Back and Forward button, and does not trigger via 'mouseup'.
$(window).on('mouseup', function(evt) {
get_content();
}
window.onpopstate = function(event) {
get_content();
}
The first one is responsible for triggering the function on first try because onpopstate only listens only when the browser's history API is populated.
Using mouseup was a bad idea, basically, don't use it unless you really want to detect mouse action from anywhere on the document.
I instead use the anchor tags/links to trigger the first function for retrieveng content.
example:
<a class="dynamic_btn" href="website.com/post">Home</a>
then
$(document).on('click','.dynamic_btn',function(e){
e.preventDefault();
get_content();
});
Using onhashchange is possible IF you have hashes on your url. I do not use hashes on my url so basically onhashchange is useless in my use case, unless I do not know something.
After retrieving the contents, I append them via creating DOM elements to existing containers from the page.
This is much easier to do if you are planning to change few elements or containers in your pages. If you plan on doing this to change a full page layout, goodluck. It's doable, but it's a really pain in tha *ss.
Upon observing Facebook, I learned that they do not implement this technique in all of their links/features. It makes sense because this is harder to maintain most especially because most of the work here is being done client side. It is very nice though because the page doesn't load.
I have implemented it on a few 'essential' functions of my website such as the viewing of posts and returning to the homepage. I can implement it on the whole site, but I am still deciding on that. That is all, thank you very much for reading internet stranger.

Facebook comment using ajax/django site

I have just one trouble adding fb comments box in my site. I use kust one url and read the content of the site using js. I put in the head the init of my fb app but I have three post in the main page and I want one comment box for every post. To load the comments of my post I use ((myurl)){{post.id}} to make unique the comment box. This url dosen't exist. But show me up difference comment for every. But don't let me moderate.. I mean dont show the moderation tool. But if i change the href of the post to my url real. Show me the noderstion tool but the same comments in every posts. Any idea???
The page is by ajax bwcause is a radio station and need to listwn the station y all contwnt. There is any way to assign thw url "manualy" in thw api of fb?

Joomla - use full article image instead of intro image

I wanted to ask if there is a possibility to force Joomla to use full article image if intro image is empty (everywhere where image should be visible).
Is there a setting for this? Is it a feature of a template or Joomla engine itself? Right now I always have to specify both of this images, cause if I specify one only full article image Joomla does not display miniature in many places. If I specify the other one miniature is there but when I enter article it is missing.
I always end up having to specify the same image twice. Is there any way around this?
Thanks
UPDATE1:
I ended up overwriting the template for article to display $images->intro_image whenever $images->image_fulltext is not available.
This solves my problems yet one joomla user tells me she is sure that they were able to do that before without any modifications in the template. So now I'm just wondering if there is a setting for this in Joomla Admin so that it does not have to be forced in template code
It turned out that each element of my page except full article used intro_image. So what I did was to copy out the part responsible for showing article into the html folder of my template and just added a php code to use intro image instead of fulltext image (if it is present). You basically need to change $image->fulltext to $image->intro_image in the condition. But remember to keep the original condition as an elseif condition if you want to be able to still use full text image

Oscommerce display default product image and prevent it from deletion

I am working on an oscommerce project where i want to display default product image (i.e no image available) if product image is not uploaded.And even i want it to prevent from deletion.I have tried to upload product not available image for 2-3 products but when deleting products i.e final last product image also gets deleted from the folder.I want that if user doesn't upload image then by default no_product_available.jpg should be shown in CATEGORIES.php as well as PRODUCT_INFO.php.
Can anyone help me to do this ? I am using oscommerce default template.
I think I understand what you would like to do... Pretty much you're saying that if someone doesn't upload an image with a product or category then you would like the no_image.jpg image to be displayed instead of nothing being displayed. Additionally, you would like for the no_image.jpg to not be deleted if the category or product is deleted. I think I can help with this...
You need to modify the tep_image() function located in catalog/includes/function/html_output.php
Replace...
if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
return false;
}
With...
if (!is_file($src)) {
$src = "images/no_image.jpg";
}
Now when you use the tep_image() function if no image was uploaded or if the file is specified but missing from the server then no_image.jpg will be displayed. When the category or product is deleted the is no_image.jpg file is not associated with the category or product so nothing is deleted. Obviously, replace "images/no_image.jpg" with the correct location and filename for your default no image file. Also, you may wish to modify the code above to get the specific behavior you want but this is a good starting point to achieve what you want.
The index.php and product_info.php pages use tep_image()... So, you should be all set there. If you're making your own page or modifying an existing one then you would of course need to use the tep_image() function to get the no_image.jpg output functionality. The parameters for tep_image() are...
tep_image($src, $alt = '', $width = '', $height = '', $parameters = '')
UPDATE:
tep_image should already be in both the index.php (the page that generates the category/product list pages) and product_info.php. Just open either file and search for "tep_image" without quotes or parentheses. You should find several instances in both files. Examine the code to understand what has already been done so that when you add a new image you understand the correct syntax.
Pretty much just place tep_image where you want your new image to show up on the page. You need to be familiar with HTML and PHP to read through the page and determine where you want the image placed. If you want to move the current image then you might be able to just cut and paste the current tep_image code to a your new location.
You can also use "Inspect Element" in Chrome in the right click menu to help determine location. Just open the page you want to add an image to and right click in the area you want to add an image to. Then look at the surrounding page source code. Now you have an idea what to look for in the PHP file.
BTW, the index.php page is a little tricky. That page is responsible for the homepage, category listing pages, and product listing pages. Also, there are several other module PHP pages that are Included (so the source code is in a different file that you'll need to track down if that's the area you want to add the image to). Make sense ;-)
Give it a try and write back with what want specifically and you did to achieve it. There are lots of people that have helped me in the past. So, I'm happy to help.

Ajax - How to change URL by content

I'll explain:
I have a picture gallery, the first page is display.php.
Users can flip through pictures using arrows, when you click an arrow it sends an Ajax request to retrieve the next picture from the db. Now I want the URL to change according to the picture displayed.
So if the first picture is:
www.mydomain.com/display.php?picture=Paris at night
I'll flip to the next one and the URL would be
www.mydomain.com/display.php?picture=The Big Ben
How do I do this?
The trick here are uri's with an anchor fragment.
The part before '#' points to a resource on the internet, and after normally designates to a anchor on the page.
The browser does not refresh if the resource is the same but moves to the anchors position when present.
This way you can keep the convenience of browser history from a usability point of view while replacing certain parts on the page with ajax for a fast and responsive user interface.
Using a plugin like jQuery history (as suggested by others) is really easy: you decorate certain elements with a rel attribute by which the plugin takes care of the rest.
Also kinda related to this topic is something called 'hijax', and it's something I really like.
This means generating html just like you would in the old days before ajax. Then you hijack certain behavior like links and request the content with ajax, only replacing the necessary parts. This in combination with the above technique allows really SEO friendly and accessible webpages.
You can use the jQuery history plugin for example.
changing the search of the url will load the changed url.
See also: stackoverflow, javascript changing the get parameter without redirecting
Do you really want to use AJAX here?
A traditional web request would work like this...
User navigates to display.php
User clicks "next" and location is updated to "display.php?picture=Big-Ben"
Big Ben is shown to user, along with a link to "display.php?picture=Parliment"
User clicks "next" and location is updated to "display.php?picture=Parliment"
And so on.
With AJAX, you essentially replace the GET with a "behind the scenes" GET, that just replaces a portion of your page. You would do this to make things faster... for example...
User navigates to display.php
User clicks "next" and the next image location is obtained using an AJAX request
The image (and image description) is changed to the next image
What you are suggesting is that you retrieve the "next url" using AJAX and then also perform a GET on the whole page. You would be much better off sending the "next" image when you send each page and not using AJAX at all.
this best describes everything i think: http://ajaxpatterns.org/Unique_URLs

Resources