Status
Not open for further replies.

bengtarne

Customer
Random gallery block works great for my forums but can't get it to work at CMS widget at home page?
There is no wdget now. Do i make a static html?

Thx
 
Sorry about that, create a new widget, the type is PHP Direct Execution

Once it's created, click Configure and put in:
In the code box, clear the contents and put
PHP:
require_once(DIR . "/dbtech/gallery/actions/widget.php");
Template Name: dbtech_gallery_cms_images
Refresh Time: 60
Or you could change the refresh time if you want, that sets it to refresh every hour
 
Sorry about that, create a new widget, the type is PHP Direct Execution

Once it's created, click Configure and put in:
In the code box, clear the contents and put
PHP:
require_once(DIR . "/dbtech/gallery/actions/widget.php");
Template Name: dbtech_gallery_cms_images
Refresh Time: 60
Or you could change the refresh time if you want, that sets it to refresh every hour

unfortunally doesn't works, just an empty box shows up.. any idea why?
Thx

This is how widget.php looks like:
<?php

/**
* Dragonbyte-Tech.com Gallery Mod
*
* @author Dylan Wheeler
* @copyright 2012
*
* You may not copy/reproduce any part of this file in whole or significant part.
*
* All rights reserved.
*/

global $vbulletin, $vbphrase;

if ($vbulletin->options['dbtech_gallery_cms_enabled'])
{
if (!class_exists(DBTECH_GALLERY))
{
// Fetch required classes
require_once(DIR . '/dbtech/gallery/includes/class_core.php');

$vbulletin->input->clean_array_gpc('r', array(
'gal' => TYPE_NOHTML
));

// Initialise
DBTECH_GALLERY::init($vbulletin, $vbulletin->GPC['gal']);
}

unset($can_view_images);

foreach ((array)$vbulletin->dbtech_gallery_instances as $instance)
{
if (DBTECH_GALLERY::fetch_gallery_perms('view', $instance))
{
$instance_array .= ',' . $instance['instanceid'];
$can_view_images = true;
}
}

if ($can_view_images)
{
$instance_array = substr($instance_array, 1);

if (intval($vbulletin->options['dbtech_gallery_cms_type']) == 1)
{
$images = $vbulletin->db->query_read("
SELECT
gi.*,
gin.shortname
FROM " . TABLE_PREFIX . "dbtech_gallery_images gi
LEFT JOIN " . TABLE_PREFIX . "dbtech_gallery_instances gin ON gi.instanceid = gin.instanceid
LEFT JOIN " . TABLE_PREFIX . "dbtech_gallery_albums ga ON gi.albumid = ga.albumid
WHERE
gi.instanceid IN (" . $instance_array . ") &&
gi.approved = 1 &&
gi.deleted = 0 &&
((gi.albumid = 0) || ((ga.hidden = 0) && (ga.password = '')) || (gi.userid = " . intval($this->userinfo['userid']) . ")) &&
gi.is_flash = 0
ORDER BY
gi.dateline DESC
LIMIT
0, " . intval($vbulletin->options['dbtech_gallery_cms_count'])
);
$output['title'] = $vbphrase['dbtech_gallery_latest_img'];
} elseif (intval($vbulletin->options['dbtech_gallery_cms_type']) == 2) {
$images = $vbulletin->db->query_read("
SELECT
ga.*,
gin.shortname
FROM " . TABLE_PREFIX . "dbtech_gallery_albums ga
LEFT JOIN " . TABLE_PREFIX . "dbtech_gallery_instances gin ON ga.instanceid = gin.instanceid
WHERE
ga.instanceid IN (" . $instance_array . ") &&
((ga.hidden = 0) || (ga.userid = " . intval($this->userinfo['userid']) . "))
ORDER BY
ga.albumid DESC
LIMIT
0, " . intval($vbulletin->options['dbtech_gallery_cms_count'])
);
$output['title'] = $vbphrase['dbtech_gallery_latest_alb'];
} elseif (intval($vbulletin->options['dbtech_gallery_cms_type']) == 3) {
$images = $vbulletin->db->query_read("
SELECT
gi.*,
gin.shortname
FROM " . TABLE_PREFIX . "dbtech_gallery_images gi
LEFT JOIN " . TABLE_PREFIX . "dbtech_gallery_instances gin ON gi.instanceid = gin.instanceid
LEFT JOIN " . TABLE_PREFIX . "dbtech_gallery_albums ga ON gi.albumid = ga.albumid
WHERE
gi.instanceid IN (" . $instance_array . ") &&
gi.approved = 1 &&
gi.deleted = 0 &&
((gi.albumid = 0) || ((ga.hidden = 0) && (ga.password = '')) || (gi.userid = " . intval($this->userinfo['userid']) . ")) &&
gi.is_flash = 0
ORDER BY
gi.weight_rate DESC
LIMIT
0, " . intval($vbulletin->options['dbtech_gallery_cms_count'])
);
$output['title'] = $vbphrase['dbtech_gallery_highest_rate'];
} elseif (intval($vbulletin->options['dbtech_gallery_cms_type']) == 4) {
$images = $vbulletin->db->query_read("
SELECT
gi.*,
gin.shortname
FROM " . TABLE_PREFIX . "dbtech_gallery_images gi
LEFT JOIN " . TABLE_PREFIX . "dbtech_gallery_instances gin ON gi.instanceid = gin.instanceid
LEFT JOIN " . TABLE_PREFIX . "dbtech_gallery_albums ga ON gi.albumid = ga.albumid
WHERE
gi.instanceid IN (" . $instance_array . ") &&
gi.approved = 1 &&
gi.deleted = 0 &&
((gi.albumid = 0) || ((ga.hidden = 0) && (ga.password = '')) || (gi.userid = " . intval($this->userinfo['userid']) . ")) &&
gi.is_flash = 0
ORDER BY
gi.views DESC
LIMIT
0, " . intval($vbulletin->options['dbtech_gallery_cms_count'])
);
$output['title'] = $vbphrase['dbtech_gallery_most_viewed'];
} elseif (intval($vbulletin->options['dbtech_gallery_cms_type']) == 5) {
$images = $vbulletin->db->query_read("
SELECT
gi.*,
gin.shortname
FROM " . TABLE_PREFIX . "dbtech_gallery_images gi
LEFT JOIN " . TABLE_PREFIX . "dbtech_gallery_instances gin ON gi.instanceid = gin.instanceid
LEFT JOIN " . TABLE_PREFIX . "dbtech_gallery_albums ga ON gi.albumid = ga.albumid
WHERE
gi.instanceid IN (" . $instance_array . ") &&
gi.approved = 1 &&
gi.deleted = 0 &&
((gi.albumid = 0) || ((ga.hidden = 0) && (ga.password = '')) || (gi.userid = " . intval($this->userinfo['userid']) . ")) &&
gi.is_flash = 0
ORDER BY
RAND()
LIMIT
0, " . intval($vbulletin->options['dbtech_gallery_cms_count'])
);
$output['title'] = $vbphrase['dbtech_gallery_random'];
}

$i = 0;

while($image = $vbulletin->db->fetch_array($images))
{
unset($image_cell);
unset($image_display);

$this_userinfo = fetch_userinfo($image['userid']);
$image['musername'] = $this_userinfo['musername'];
$image['username'] = $this_userinfo['username'];

$image_data['title'] = construct_phrase($vbphrase['dbtech_gallery_img_info_hover'], $image['username'], $image['filename'], $image['title'], $image['views'], DBTECH_GALLERY::fetch_image_size($image['filesize']));

if (intval($vbulletin->options['dbtech_gallery_cms_type']) != 2)
{
$image_data['filename'] = DBTECH_GALLERY::fetch_file_path($image['imageid'], 'gallery_thumb', $image['shortname']);
$image_data['linkurl'] = DBTECH_GALLERY::fetch_file_path($image['imageid'], 'link_url_clean', $image['shortname']);
} else {
$image_data['filename'] = DBTECH_GALLERY::fetch_file_path($image['imageid'], 'gallery_folder', $image['shortname']);
$image_data['linkurl'] = DBTECH_GALLERY::fetch_file_path($image['userid'], 'user_album', $image['shortname'], $image['albumid']);
}

if (intval($vbulletin->options['dbtech_gallery_cms_type']) == 2)
{
$image_data['box_new_width'] = 230;
$image_data['title'] = '';
} else {

$filename = DBTECH_GALLERY::fetch_image_path($image['imageid']) . '/thumb/' . $image['imageid'] . '_' . $image['dateline'] . '.' . $image['filetype'];
$img_info = getimagesize($filename);
$image_data['box_new_width'] = $img_info[0] + 10;
$image_data['img_new_width'] = $img_info[0];
$image_data['img_new_height'] = $img_info[1];
}

$img_full_width += $image_data['box_new_width'] + 20;

$dbtech_gallery_img_data[] = array('filename' => $image_data['filename'], 'linkurl' => $image_data['linkurl'], 'title' => $image_data['title'], 'box_width' => $image_data['box_new_width'], 'img_width' => $image_data['img_new_width']);
}

$output['data'] = $dbtech_gallery_img_data;
$output['full_width'] = $img_full_width;

$vbulletin->db->free_result($images);
} else {
$output['data'] = 'none';

$vbulletin->db->free_result($images);
}
}

?>
 
Last edited:
Could I get a temp admin account to check it out? That's how I have it on my dev site and it's working there.

For security reasons, we recommend you create a new AdminCP account only for DBTech support, then disable or delete it after we have both confirmed the issue has been solved and there are no further issues. It should ideally be a temporary account created for us only. If we have created an account on your site already, you can optionally boost that account to Administrator and then de-admin this account once the issue has been solved.

If you use a .htaccess password protection for your AdminCP directory, it is recommended that you create a new authorised user for DBTech and remove this user once the issue has been solved.

Please test any temporary accounts you create to ensure that the AdminCP account can access the administrative controls for the product we are assisting you with.

Ensuring this is all in order before submitting the information will significantly speed up the process of assisting you. We will alert you via PM if there's any issues with the login information you have provided.

When sending the PM, for your security you should also un-tick the "Save a copy in my Sent Items folder" checkbox. When the access details have been received, we will delete the PM from our inbox. Ensuring you have not kept a copy of the PM reduces the risk of security breaches.

Thank you for helping us debug our products and allowing us to assist you, we appreciate it
 
could I get ftp? It all seems right, not sure why the save button isn't working or why CMS isn't showing images.
 
The submitting images works now. When you removed the camera fields it screwed up the ajax script. Took me a bit but I figured it out :)
I'm still working on the CMS problem.
 
The submitting images works now. When you removed the camera fields it screwed up the ajax script. Took me a bit but I figured it out

Hehe sorry!! Hope i didn't make you to frustrated, Goodjob!
Good luck with CMS box. I keeping my fingers cross now that it isn't anything i've caused;)
 
Hi! I saw you just logged on my site, i temporary removed widget from layout just cause it messed up site.. just so you know=) (you would ofc notice this in 1 sec but wanted to say it so you don't think i removed it cause i didn't want it anymore)
 
Sorry about that, was testing some things out trying to get it working before running some errands today. I'll keep working on it, not sure what's causing it but I'm sure it's gotta be something small that I'm just missing.
 
Status
Not open for further replies.

Legacy DragonByte Gallery

vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
865
Customer rating
0.00 star(s) 0 ratings
Back
Top