[Solved] CGSmartImage only visible to Admin

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
clapczyn
Forum Members
Forum Members
Posts: 59
Joined: Tue Oct 27, 2009 2:00 pm

[Solved] CGSmartImage only visible to Admin

Post by clapczyn »

Hi everyone,

i've got a really strange problem and I cant find any solution for it.
CGSmartImage doesn't show any images except when I'm logged in as admin in the same browser that views the page.

As soon as I'm logged in the cache-directory fills up upon pagevisits (and the images load) When I log out and clear my browser cache the images won't show.

There is nothing shown on the page, but in the Admin Log it says "A required parameter was missing or invalid: src"
The module-call that looks like this (and works when logged in):

Code: Select all

{capture assign="content_img_url"}
{content_image label='ContentImage' block='content_image' dir='contentpage' urlonly='true'}{/capture}
{CGSmartImage src=$content_img_url filter_croptofit="264,259"}
In CGSmartImage the following options are set:
Responsive – everything on NO
Embedding - Smart, 32kb
General:
Force file extension: YES
CachePath – uploads/_CGSmartImage
Suppress Errors – NO
preemptive memory check – NO

Anything that helps is appreciated – I just don't know where to go from here …

THX alot!

----------------------------------------------
Cms Version: 2.1.1
Installed Modules:
AdminSearch: 1.0
CMSContentManager: 1.1
DesignManager: 1.1.1
FileManager: 1.5.2
MenuManager: 1.50.2
MicroTiny: 2.0.2
ModuleManager: 2.0.1
Navigator: 1.0.2
LISE: 1.1
Search: 1.50.2
CGExtensions: 1.51.1
CGSmartImage: 1.21
SiteMapMadeSimple: 1.2.8
LISE: 1.1

Config Information:
php_memory_limit:
max_upload_size: 128000000
url_rewriting: none
page_extension:
query_var: page
auto_alias_content: true
locale:
set_names: true
timezone: Asia/Singapore
permissive_smarty: false

Php Information:
phpversion: 5.5.31
md5_function: On (True)
json_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
E_STRICT: 2048
E_DEPRECATED: 0
test_file_timedifference: No time difference found
test_db_timedifference: No time difference found
create_dir_and_file: 1
memory_limit: 128M
max_execution_time: 30
register_globals: Off (False)
output_buffering: On
disable_functions:
open_basedir:
test_remote_url: Success
file_uploads: On (True)
post_max_size: 128M
upload_max_filesize: 128M
session_save_path: /tmp (1777)
session_use_cookies: On (True)
xml_function: On (True)
xmlreader_class: On (True)
check_ini_set: On (True)
curl: On

Performance Information:
allow_browser_cache: On (True)
browser_cache_expiry: 60
php_opcache: Off (False)
smarty_cache: On (True)
smarty_compilecheck: Off (False)
smarty_cache_udt: On (True)
auto_clear_cache_age: On (True)
Server Information:
Server Software: Apache
Server Api: cgi-fcgi
Server Os: Linux 3.14.25-grsec.3.el5 On x86_64
Server Db Type: MySQL (mysql)
Server Db Version: 5.5.40
Server Db Grants: Found a "GRANT ALL" statement that appears to be suitable

Permission Information:
tmp: /home/site5/public_html/tmp (0755)
tmp_cache: /home/site5/public_html/tmp/cache (0755)
templates_c: /home/site5/public_html/tmp/templates_c (0755)
modules: /home/site5/public_html/modules (0755)
uploads: /home/site5/public_html/uploads (0755)
File Creation Mask (umask): /home/site5/public_html/tmp/cache (0755)
config_file: 0444
----------------------------------------------
Last edited by clapczyn on Fri Jan 22, 2016 8:42 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: CGSmartImage only visible to Admin

Post by Dr.CSS »

Sounds like the src= is coming up blank, have you tried just using the assign= in the {content_image} tag..?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CGSmartImage only visible to Admin

Post by calguy1000 »

As DrCss mentioned you shouldn't be using the {capture} tag unless absolutely necessary.

But I think the problem you are having is related to smarty caching.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CGSmartImage only visible to Admin

Post by calguy1000 »

To follow up.... I think I see what is happening, and you will need a bit more understanding in how smarty caching works.

Generally, it converts your smarty template to cacheable text.

i.e: the stuff that is cached will be the results to {somecall}

Given this code:
{content_image block='foo' assign='foo'}
{CGSmartImage src=$foo}

The first line outputs no data... so there is nothing to cache.
The second line assumes that there is data in the smarty $foo variable, and generates an error.

Now. the nocache attribute to smarty plugins can be useful in bypassing cache in some circumstances.

so I would try
{content_image block=foo assign=foo nocache}
{CGsmartImage src=$foo}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
clapczyn
Forum Members
Forum Members
Posts: 59
Joined: Tue Oct 27, 2009 2:00 pm

Re: CGSmartImage only visible to Admin

Post by clapczyn »

That did the trick, thanks a lot!!!
I would've never thought of that …

[Edit]
though I still don't understand why it worked when I was logged in ???
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: [Solved] CGSmartImage only visible to Admin

Post by calguy1000 »

though I still don't understand why it worked when I was logged in ???
Because when you are logged in to the admin (in the same browser session) caching is explicitly disabled. This is so that you can immediately see changes that you implement.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Modules/Add-Ons”