This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

img src Path Incorrect
#1

The function cmtx_commentics_url() in page.php seems to return NULL (blank). Hence the Absolute-path generated for "<img src=..." in processor.php using the function cmtx_commentics_url() is incorrect. The result is that the icons related to "Smilies and Editing" are not displayed. "Viewing Page Source" confirms incorrect path. I am using v2.5

example: <img src="images/smilies/smile.gif" title="Smile" Alt="Smile" ... ...

Is this noticed by others? Is there a patch?

Ramesh Rao
Reply
#2

Is the value of your 'Commentics URL' setting in 'Settings -> System' correct?

Have you completed the interview?
Reply
#3

Hi,

Thanks for the quick response. The Commentics URL is correctly set and it is http://rkgenealogy.com/gen/comments/. Site URL is: http://rkgenealogy.com.

An "echo $url" statement, such as below, inserted inside the code "function cmtx_commentics_url()" (page.php) inexplicably pre-pends and builds the 'absolute path' for the images. and the Form screen is complete with Smilies etc.
======================================================================================
echo "$url";

if (!parse_url(cmtx_setting('commentics_url'), PHP_URL_PATH) || !filter_var($url, FILTER_VALIDATE_URL)) {
$url = cmtx_url_encode(cmtx_setting('commentics_url'));
}
=====================================================================================

If on the other hand "echo $url" is placed immediately after three code-lines above, absolute path is NOT generated. This leads me to believe that the three lines of code re-sets variable $url to NULL or blank. And the string returned by cmtx_commenrics_url() is NULL or blank. I may be wrong.

Commentics supplied Example code can be run as: rkgenealogy.com/gen/cmtx.php.

Thanks in advance.
Ramesh Rao
Reply
#4

Can you let me know what the following outputs when added near the top of that function.

PHP Code:
<?php 
var_dump
('1: ' . cmtx_setting('commentics_url'));
var_dump('2: ' . parse_url(cmtx_setting('commentics_url'), PHP_URL_PATH));
if (isset(
$_SERVER['HTTPS'])) {
var_dump('3: ' . $_SERVER['HTTPS']);
} else {
var_dump('3: Not Set');
}
var_dump('4: ' . $_SERVER['HTTP_HOST']);
$url = 'http' . ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 's' : '') . '://' . strtolower($_SERVER['HTTP_HOST']) . parse_url(cmtx_setting('commentics_url'), PHP_URL_PATH);
var_dump('5: ' . $url);
$url = cmtx_url_decode($url);
var_dump('6: ' . $url);
$url = cmtx_url_encode($url);
var_dump('7: ' . $url);
var_dump('8: ' . filter_var($url, FILTER_VALIDATE_URL));
var_dump('9: ' . cmtx_url_encode(cmtx_setting('commentics_url')));

Also does your server have the 'Filter' extension, which filter_var is a part of, enabled? If not then it could be causing a PHP error that's consequently affecting the output of the function. It would have said this during the system check of the installer or you can also find out using 'Reports -> PHP Info'.

Have you completed the interview?
Reply
#5

Hi Steven,

Here is the output:


string(39) "1: http://rkgenealogy.com/gen/comments/" string(17) "2: /gen/comments/" string(10) "3: Not Set" string(18) "4: rkgenealogy.com" string(39) "5: http://rkgenealogy.com/gen/comments/" string(39) "6: http://rkgenealogy.com/gen/comments/" string(39) "7: http://rkgenealogy.com/gen/comments/" string(39) "8: http://rkgenealogy.com/gen/comments/" string(39) "9: http://rkgenealogy.com/gen/comments/" I have read and understand the privacy policy. *

string(39) "1: http://rkgenealogy.com/gen/comments/" string(17) "2: /gen/comments/" string(10) "3: Not Set" string(18) "4: rkgenealogy.com" string(39) "5: http://rkgenealogy.com/gen/comments/" string(39) "6: http://rkgenealogy.com/gen/comments/" string(39) "7: http://rkgenealogy.com/gen/comments/" string(39) "8: http://rkgenealogy.com/gen/comments/" string(39) "9: http://rkgenealogy.com/gen/comments/" I have read and agree to the terms and conditions.

Thanks a lot.. Meanwhile let me try to find out answer to your other questions. Will get back to you.

Ramesh
Reply
#6

Hi Steve,

The formatted output (from View Page Source) is here..

<!-- Start of Commentics -->

<div class="cmtx_container">

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css"/>

<link rel="stylesheet" type="text/css" href="string(39) "1: http://rkgenealogy.com/gen/comments/"
string(17) "2: /gen/comments/"
string(10) "3: Not Set"
string(18) "4: rkgenealogy.com"
string(39) "5: http://rkgenealogy.com/gen/comments/"
string(39) "6: http://rkgenealogy.com/gen/comments/"
string(39) "7: http://rkgenealogy.com/gen/comments/"
string(39) "8: http://rkgenealogy.com/gen/comments/"
string(39) "9: http://rkgenealogy.com/gen/comments/"
external/colorbox/colorbox.css"/>

<link rel="stylesheet" type="text/css" href="string(39) "1: http://rkgenealogy.com/gen/comments/"
string(17) "2: /gen/comments/"
string(10) "3: Not Set"
string(18) "4: rkgenealogy.com"
string(39) "5: http://rkgenealogy.com/gen/comments/"
string(39) "6: http://rkgenealogy.com/gen/comments/"
string(39) "7: http://rkgenealogy.com/gen/comments/"
string(39) "8: http://rkgenealogy.com/gen/comments/"
string(39) "9: http://rkgenealogy.com/gen/comments/"
css/default.css"/>

Thanks,
Ramesh
Reply
#7

Hi Steven,

Not sure about filter extension. What string should I search for in Reports: PHP php output?

Ramesh
Reply
#8

Hi Steven,

I seem to have identified the problem - though not a solution.

My Main Domain Name: kiduvinhouse.net, Home Directory: /home/kiduvinh 
Add-on Domain Name : rkgenealogy.com 

Two test cases built: 
- kiduvinhouse.net/comments
- rkgenealogy.com/gen/comments  (full path kiduvinhouse.net/rkgenealogy.com/gen/comments

1. Commentics fails with URL: http://www.rkgenealogy.com/gen/comments/

2. Commentics fails again, if the above URL is changed to: http://kiduvinhouse.net/rkgenealogy.com/gen/comments/

3. Commentics works successfully (limited test done) when URL is: http://www.kiduvinhouse.net/comments/

Summary: Commentics built under the main domain works fine. When built under the add-on domain, URL generated is incorrect and hence fails (Smilies etc not displayed).  May be URL generation algorithm needs tweaking. 

Test cases can be run as: 
1. kiduvinhouse.net/cmtx.php
2. rkgenealogy.com/gen/cmtx.php

Let me know if you need any more data.

Ramesh
Reply
#9

I don't quite understand why for your add-on domain you have entered the 'Commentics URL' setting as "http://www.rkgenealogy.com/gen/comments/" when it appears to be installed at "http://www.rkgenealogy.com/comments/". Your site is redirecting from the former to the latter (possibly using .htaccess), so, while this works in terms of PHP, the links to the stylesheet and javascript are failing because they're referring to a /gen/ folder which doesn't seem to exist.

For the filter extension search for the string "filter" and you should eventually see a section like in my attachment.

   

Have you completed the interview?
Reply
#10

Hi Steven,

The actual path is "http://www.rkgenealogy.com/gen/comments/". Directory "gen" does exist under rkgenealogy.com. With .htaccess I am redirecting it to right page (and avoid the need to type gen). User types in http://rkgenealogy.com. Obviously the test script can be invoked as rkgenealogy.com/gen/cmtx.php or rkgenealogy.com/cmtx.php. (I have tried both.)

In fact I tried disabling .htaccess file (no redirecting). This too did not resolve the problem.

Thanks,
Ramesh
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Looking
12-Jul-2011, 12:09 PM
Last Post by archym
02-Jul-2011, 02:29 PM
Last Post by Steven
07-Jun-2011, 10:37 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)