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

Upload not showing
#1

Hi,


I'm having trouble with user uploaded images. On the comments page it only shows "Upload" in place of the picture thumbnails and clicking on it only produces blanks. However, in the backend the thumbnails and pictures work just fine.

The source code for that section is:
<a href="" data-cmtx-rel="cmtx_rel_11" class="cboxElement">
<img src="" class="cmtx_upload" alt="Upload">
</a>

In frontend error reporting multiple errors are recorded:
PHP Notice:  Undefined index: image in /.../comments/frontend/view/default/template/main/comment.tpl on line 115

This is a new installation. During testing, the first uploaded image did successfully show up. It seems the problem appeared after I deleted the first comment and its user, I'm not sure though.

Please help, thanks.
Reply
#2

Something else on your page might be conflicting. Can you provide a link so I can determine what's happening?

Have you completed the interview?
Reply
#3

Hi Steven, I have PMed you the link.
Reply
#4

Thanks. What's your 'Commentics URL' setting in 'Settings -> System'?

Have you completed the interview?
Reply
#5

It's URL/comments/
I haven't changed this setting since installation.
Reply
#6

Okay I have a couple of ideas as to what's happening but it's something which I'd need to debug.

I'd be happy to take a proper look this weekend if you send over FTP and admin access.

https://www.commentics.org/support/index.php?a=add

Have you completed the interview?
Reply
#7

Could you point me in the right direction because I can't provide the access you ask for?
Reply
#8

In /frontend/controller/main/comments.php

You need to look at the code below:

PHP Code:
<?php 
foreach ($uploads as $key => &$upload) {
if (
file_exists(CMTX_DIR_UPLOAD . $upload['folder'] . '/' . $upload['filename'] . '.' . $upload['extension'])) {
$upload['image'] = $this->url->getCommenticsUrl() . 'upload/' . $upload['folder'] . '/' . $upload['filename'] . '.' . $upload['extension'];
} else {
unset(
$uploads[$key]);
}
}

Find out which part it's going into, whether the file exists at the location it's concatenating, and do var_dump($uploads); before and after the code block above.

Have you completed the interview?
Reply
#9

I have added var_dump($uploads); as instructed, but I'm quite new to this and I don't know where the output is supposed to be found.
What I don't quite understand is since I hadn't changed any of the code when the problem occurred, and the images do show up when doing comments/backend/index.php?route=edit/comment&id=x, so it's unlikely a database or a path/file issue, what do you think could've caused this?
Reply
#10

I don't know which is why it has to be debugged. If you can't give me access and you can't debug it yourself then unfortunately it can't be resolved.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
13-Aug-2021, 08:01 AM
Last Post by 2hands
18-Nov-2017, 11:21 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)