vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Latest Photopost Photo In Postbit (https://vborg.vbsupport.ru/showthread.php?t=72335)

sabret00the 11-29-2004 10:00 PM

Latest Photopost Photo In Postbit
 
Ok so i'm in the middle of developing something cool and it seems that a few people actually only want half of what i'm attempting to do so for you all here you go. Peace, Love and Happiness!

Damn almost forgot the desciption, erm this hack puts a photo, but not just any photo, your last uploaded photo into your postbit, it's s3x11111!!!!! i think :o.

Ok theirs one question i don't ever ever ever want to see in this thread, unless you're sure you have www.photopost.com's photopost installed, save us all the heartache and just don't do it, be kind, be generous, show me love, but if you aint got photopost installed then what's the point in saying "it don't show the photo for me" it's bound not to :( oh and for people who are going to ask "can you do it for the vB photo" nope i'm afraid i've never tried :(

ok after that little bit i should say something cool, like screenshots are not present since i have no desire to install this as is, no wait that sucked, however if anyone would like to provide screenies, you're welcome yay.

Damn is their nothing else i can waste your time with, surely you have no better to do than read my garbage, guess not, oh well it's an easy installation, i estimates 3.75 minutes, 2 files edits, one template mod, 1 vB option group and a setting to fill it.

[high]big thanks to natch without him it would've been impossible and thanks to dean c (mist) too who got me through the final stages like a lucazade during a marathon.[/high]

[high] * sabret00the does cool guy pose[/high]

have fun with it. :p :)

Query Load: beleive it or not, from the dungeon of super sucky coders this came and only adds one query to the showthread, i'm not even lying, wow, well that's what the microstats said, so if i was wrong blame Neo, he's obviously misalligned the matrix.

think i covered everything now :)

in your includes/functions_showthread.php find
PHP Code:

// ###################### Start process_highlight_postbit #######################
       
function process_highlight_postbit($text$words$prepend

above that add
PHP Code:

// ###################### Start last photopost photo #######################
       
function fetch_galleryavatarcache()
       {
           global 
$DB_site$galleryavatarcache;
           if (!
is_array($galleryavatarcache))
           {
               
$galleryavatarcache = array();
               
$allgalleryavatars $DB_site->query("
          SELECT pp_photos.id, pp_photos.title, user.userid, pp_photos.cat, pp_photos.approved, pp_photos.bigimage
                   FROM ppost_photos AS pp_photos
             LEFT JOIN " 
TABLE_PREFIX ."user AS user ON pp_photos.userid = user.userid
               "
);
       
               while(
$galleryavatararray $DB_site->fetch_array($allgalleryavatars))
               {
            
$galleryavatarcache["$galleryavatararray[userid]"] = $galleryavatararray;
               }
       
               
$DB_site->free_result($allgalleryavatars);
           }
       }
       
       function 
fetch_cachedgalleryavatar_url($userid)
       {
           global 
$galleryavatarcache$vboptions$stylevar;
           if(!
is_array($galleryavatarcache))
           {
               
fetch_galleryavatarcache();
           }
           if(
$galleryavatarinfo $galleryavatarcache[$userid])
           {
               if (
$galleryavatarinfo[bigimage] && $galleryavatarinfo[cat])
               {
          return 
"$vboptions[galleryurl]/data/$galleryavatarinfo[cat]/{$userid}".substr($galleryavatarinfo[bigimage], 0, -4)."-thumb.".file_extension($galleryavatarinfo[bigimage]);
               }
               else
               {
                   return 
"$stylevar[imgdir_misc]/noavatar.gif";
               }
           }
           return 
FALSE;
       } 

now in your showthread.php find
PHP Code:

        $post['musername'] = fetch_musername($post);
               
$post['islastshown'] = ($post['postid'] == $lastpostid);
               
$post['attachments'] = &$postattach["$post[postid]"]; 

and directly below that add:
PHP Code:

        $post['galleryavatar'] = fetch_cachedgalleryavatar_url($post[userid]); 

now chuck your board into debug mode and add this setting group:
Code:

vaname: photopost
      title: Photopost
      vB default: no

now add to that group this option
Code:

      varname: galleryurl
      title: Gallery URL
      Description: this is the location to your photopost installation (no trailing backslash)
      Option: [leave this blank]
      Default: http://www.domainname.com/directory
      vB default: no

now in your postbit template, whereever you want it add
HTML Code:

<if condition="$post[galleryavatar]"><a href="$vboption[galleryurl]/showgallery.php?cat=500&ppuser=$post[userid]"><img src="$post[galleryavatar]" border="0" alt="$post[username]'s latest photo" /></a></if>

hdraye 11-30-2004 01:35 PM

Thanx

But what do you mean here?
============================

now chuck your board into debug mode and add this setting group:
======================================

sabret00the 11-30-2004 01:40 PM

check this thread it goes through many ways of turning on debug mode on your forums
https://vborg.vbsupport.ru/showpost....15&postcount=1 bar that, it's just a matter of adding
PHP Code:

$debug 1

to the top of your config.php

hdraye 11-30-2004 01:50 PM

Sorry, but do I have to have pp tables under VB database? I have separate bases and I get an error that tabel "forum" does not exist

I forgot the message but I had to uninstall as no one can access the VB because of the error

Thanx again

Hani

KTBleeding 11-30-2004 01:50 PM

Sounds very interesting. Does the image link to the users galleries too? And... I'm curious as to what the full version of this hack is going to be. ;)

hdraye 11-30-2004 01:55 PM

well, I meant adding the setting group, not the debug :( as it is mentioned/not mentioned in the manual

I appreciate your help

Thanx again and again

Hani

sabret00the 11-30-2004 02:18 PM

Quote:

Originally Posted by hdraye
Sorry, but do I have to have pp tables under VB database? I have separate bases and I get an error that tabel "forum" does not exist

I forgot the message but I had to uninstall as no one can access the VB because of the error

Thanx again

Hani

yes you do need em in the same database.

also in the query theirs the line
PHP Code:

FROM ppost_photos 

make sure that matches your photopost table prefix so you'd change it from ppost_ to photopost_ or whatever.

sabret00the 11-30-2004 02:19 PM

Quote:

Originally Posted by KTBleeding
Sounds very interesting. Does the image link to the users galleries too? And... I'm curious as to what the full version of this hack is going to be. ;)

yes it does link to the users gallery, the full version isn't that spectacular, it's just the ability to have the latest photopost picture (thumbnail) as your avatar.

sabret00the 11-30-2004 02:21 PM

Quote:

Originally Posted by hdraye
well, I meant adding the setting group, not the debug :( as it is mentioned/not mentioned in the manual

I appreciate your help

Thanx again and again

Hani

once your board is in debug mode, go to the main options screen
http://yourdomain.com/forums/admincp/options.php?null=0
and you'll see an option to add a new settings group.

hdraye 11-30-2004 02:35 PM

well, as the PP base must be the same as VB base, then this is not for me :(


All times are GMT. The time now is 10:06 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.01188 seconds
  • Memory Usage 1,779KB
  • 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_html_printable
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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