vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Photopost "gallery" clickable icon in postbit(_legacy) and/or profiles. (https://vborg.vbsupport.ru/showthread.php?t=111962)

funkmeister 12-12-2006 12:50 PM

To clarify......in 'gallery.php' do we replace the field id number (field61 in the example below) with whatever our field number is, which is created earlier in the instructions?

Quote:

$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."userfield SET field61 = 'Yes' WHERE ".TABLE_PREFIX."userfield.userid = $posid AND ".TABLE_PREFIX ."userfield.field61 != 'Yes'");
Thanks in advance.

Grunt 02-20-2007 08:25 AM

Thanks once again Mini - good stuff.

Working in 3.6.4 and PP 5.6.2 (sharing DB and no prefixes on either). I had to modify code a bit. Working code if it helps anyone is:

postbit:
Code:

<if condition="$post['field7'] == 'Yes'">
<a href="/gallery/showgallery.php?cat=500&ppuser=$post[userid]" target="_blank">
<img class="inlineimg" src="$stylevar[imgdir_misc]/gallery.gif" alt="View $post[username]'s Gallery" width="19" height="18" border="0" title="View $post[username]'s Gallery" /></a>
</if>

gallery.php:
Code:

<?
////////////////////////////////////////////
//  MAKE SURE YOU EDIT THIS WHERE STATED  //
//  Then upload to /includes/cron/        //
////////////////////////////////////////////
// Edit - Make sure this is correct
define('FILE_VERSION', '3.6.4'); // this should match install.php
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db))
{
 exit;
}
// Edit this line to reflect your database structure
$photo_query=$vbulletin->db->query_read("SELECT userid FROM photos");
while ($inids = $vbulletin->db->fetch_array($photo_query)) {
 $posid = $inids[userid];
 $vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."userfield SET field7 = 'Yes' WHERE ".TABLE_PREFIX."userfield.userid = $posid AND ".TABLE_PREFIX ."userfield.field7 != 'Yes'");
}
log_cron_action("gallery task updated", $nextitem);
?>


Grunt 02-20-2007 08:31 AM

and a different icon

SherryG 02-23-2007 08:12 PM

*Solved*

atvtrailrider 03-21-2007 05:46 PM

Here is the error I am getting when it runs the cron:

> MySQL Error : Access denied for user 'vborforumuser'@'localhost' to database 'photopost'

vborforumuser is set as the "User Database User" in my photopost config. I think the task needs to use my "PhotoPost Database User" instead. How do I get the task to run as a different user?

Suggestions?

Doug Nelson 04-27-2007 02:54 PM

Has this been updated for 3.6.5?

Doug Nelson 05-03-2007 02:59 AM

That would be a "no"?

PEPITO69 08-10-2007 07:04 PM

Is it possible to make the same with reviewpost? showing the reviews of a member.

sgrynd 08-17-2007 03:26 PM

Thanks, great hack - running on 3.7 as well.

For those with the db error, make sure gallery.php is set to use the correct database and table name

mirzonni 09-19-2007 08:06 PM

It works with 3.6.8 after some minor modifications. Excellent hack! Cheers.


All times are GMT. The time now is 06:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01649 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete