• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

    • ⚠️ Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • ✅ Confirm that the server meets the System Requirements
    • 🔥 Check for any available Hotfix - your issue could be already reported/fixed
    • 📚 Read documentation - It will be required to Debug and understand Errors for a faster support response

Embed Images From User Accounts in to HTML Code

PHP:
<?php
$route = function($handler) {
    try {
        $username = $handler->request[0]; // Gets 'newmedia' user (string) from http://vr.newmediaart.co/newmedia
        $user = CHV\User::getSingle($username, 'username'); // Gets user details by username
        if(!$user) {
            $handler->issue404();
        }
        $list = new CHV\Listing; // Creates a new Listing object
        $list->setType('images'); // You want to get images
        $list->setOffset(0); // Starer pointer, used when you paginate results
        $list->setLimit(1); // how many results?
        $list->setItemsPerPage(1); // Limit same as the results
        $list->setSortType('date'); // Sort criteria: date | size | views
        $list->setSortOrder('desc'); // Sort order: asc | desc
        $list->setWhere('WHERE image_user_id=:user_id');
        $list->bind(":user_id", $user['id']); // Numeric user ID (or true ID)
        $list->exec();
        $vroutput = '';
        foreach($list->output_assoc as $k => $v) {
            $vroutput .= '<a-image src="'.$v['display_url'].'" rotation="0 0 0" position="0 2 -11.4"></a-image>' . "\n";
        }
        $handler->setVar('vroutput', $vroutput); // use it in the theme file with echo get_vroutput();
    } catch(Exception $e) {
        G\exception_to_error($e);
    }
};
 
You need to add your custom position code inside the foreach.
 
I tired with position="0 0 0"

And nothing renders to the page it should show the image in front of me with that position
 
1. Make sure that $vroutput contains anything.
2. Use print_r or G\debug to debug

If $vroutput is empty you won't render anything.
 
I've tried to add both <?php print_r ?> and also tired to add <?php G/debug ?> to the user template file and nothing is showing.
 
I've tried to add both <?php print_r ?> and also tired to add <?php G/debug ?> to the user template file and nothing is showing.
This may be a stupid question... but you have debugging and error reporting turned on, right?
 
You will need to debug a lot the listing and what you are generating. The thing is that you need to play with it, I have provided you with all the code so anything extra is up to you.
 
Based on how you ask this I can tell that you don't know PHP. Please note that this is a support forum for Chevereto, I can't teach you PHP here because that doesn't add value to "Chevereto" which is what I must do with the support section. That is what other customers want from all this.

I'm afraid that everything you need is right there, even the debug functions. But if you don't know PHP this could take months.

So, you need to debug the listing. First, is the listing getting anything at all? Then, is the foreach doing a proper job? Etc. Start debuging from top and debug each variable related.
 
Based on how you ask this I can tell that you don't know PHP. Please note that this is a support forum for Chevereto, I can't teach you PHP here because that doesn't add value to "Chevereto" which is what I must do with the support section. That is what other customers want from all this.

I'm afraid that everything you need is right there, even the debug functions. But if you don't know PHP this could take months.

So, you need to debug the listing. First, is the listing getting anything at all? Then, is the foreach doing a proper job? Etc. Start debuging from top and debug each variable related.
Thanks for all your help I just got myself a course on PHP when I've worked it all out I'll post the results. Thanks again looking forward to working it out.
 
Back
Top