View Single Post
  #382  
Old 05-14-2009, 11:21 AM
WildSoftCat WildSoftCat is offline
 
Join Date: Mar 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, Cellarius !

Maybe it will be useful for somebody with photopost :

includes/class_bbcode.php in function handle_bbcode_img_match($link) find

PHP Code:
return '<img src="' .  $link '" border="0" alt="" />'
and replace with

PHP Code:
$cat "";
$big "";
$search "photopost/data";
$i strpos $link$search );

if  ( 
$i != )
{
$cat substr $link$i strlen $search ) + );
$cat str_replace "medium/" ""$cat );
$i strpos ($cat"/" );
$big substr $cat$i );
$cat substr $cat0$i );

$query "SELECT * FROM `pp_photos` WHERE (cat = " $cat " AND bigimage = '" $big "') OR (storecat = " $cat " AND bigimage = '" $big "') ";

$results $this->registry->db->query_read("$query);

if (
$this->registry->db->num_rows($results) > 0)
   {
   while (
$result $this->registry->db->fetch_array($results))
    {
      
$corr $result['id'];
      
$tit $result['title'];
      }
   }
$gal 'http://www.art-in-exile.com/forums/photopost/showgallery.php?cat=' $cat;
$pic 'http://www.art-in-exile.com/forums/photopost/showphoto.php?photo=' $corr;

$linkg '<td align="left"><div class="smallfont"><a href="' $pic '" target="_blank">' $tit '</a></div></td><td align="right"><div class="smallfont"><a href="' $gal '" target="_blank">Gallery</a></div></td>'

        return 
'<table><tr><td colspan=2><img src="' .  $link '" border="0" alt="" /></td></tr><tr>' $linkg '</tr></table>';
}
else
{
        return 
'<img src="' .  $link '" border="0" alt="" />';

This adds links to gallery and photo below image ( [IМG] tag ), only if image is in photopost datastore. Links addition on-fly, during show (showthread e.g.), not during posting or editing.

Sorry, i've no time to do it well, so this code needs some replacement for user's config :

1. path to photopost (2 lines)
2. determine photopost in link to image : $search = "photopost/data";
3. photopost tables prefix : pp_

DEMO here

Maybe somebody can do it better

This code needs yet one replacement in another file, who is interested in it - PM, please
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01172 seconds
  • Memory Usage 1,794KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete