Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 12-19-2016, 04:20 PM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As of yet, I'm still using Photopost, too. I can't really remember the installation process, but from what I can see one had to manually create a plugin at forumhome_complete, doing nothing but including the gallery's inc_features.php file.

In my case the single line is
PHP Code:
include('./[dir_to_gallery]/inc_features.php'); 
Reply With Quote
  #12  
Old 12-19-2016, 07:35 PM
Phil Dart Phil Dart is offline
 
Join Date: Dec 2016
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne - thanks for your reply.

The block I'm trying to create is to go in an existing column of blocks on my home page. The controls for that column already exist within Forums & Moderators>Forum Blocks Manager, and I know the column works because there are already one or two blocks in it, both of which I have edited myself without issue.

The side block is on the home page, which is indeed the same page as the existing random images appear, but only because I was hoping to have the side block working before I switch off the existing images. I can do that now though if you think it may be causing a conflict

My version of vB is 4.2.3 - my control panel has a section labelled Plugins & Products. Looking in there I can see Manage Products, and Plugin Manager.

Manage Products shows me no useful information at all, beyond that it is PhotoPost Pro v8.2

Plugin Manager shows me various different options to explore and I've pasted a screenshot of those options below. There is no menu option Hooks Manager, but each of the options in the screenshot shows a hook. I can't identify which would be relevant though, and I'm not entirely certain that any of them are, but that may just be further proof of my total ignorance of the subject.
Attached Images
File Type: jpg pppro_plugin_manager.jpg (154.5 KB, 0 views)
Reply With Quote
  #13  
Old 12-20-2016, 06:22 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not Lynne, but maybe you're reading my posts anyway

As I said: It's at the hook forumhome_complete, so it's obviously "Photopost Featured Photos on Forumhome". Open it, and you'll find the code I posted above.
Reply With Quote
  #14  
Old 12-20-2016, 08:09 AM
Phil Dart Phil Dart is offline
 
Join Date: Dec 2016
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Cellarius - sorry, I don't know how I missed your post.

Yes, Photopost Featured Photos on Forumhome - Doh!!! I did warn you I am dim. However , no code resembling yours within it I'm afraid.

Code:
require $vbulletin->options['pppath'].'/config-int.php';

$dbhost = $vbulletin->options['dbhost'];
$dbuser = $vbulletin->options['dbuser'];
$dbpass = $vbulletin->options['dbpass'];
$dbname = $vbulletin->options['db1'];
$link = mysql_connect ("$dbhost", "$dbuser", "$dbpass") or die('I cannot connect to the database.');
mysql_select_db ("$dbname")or die("Could not select photopost database");

// Number of photos to display
$num_display = 4;

// Number of columns (1 for vertical)
$columns = 4;

// which type of images do you want to show (random, most_view, latest)
$q_switch = "random";


// == END CONFIGURATION ==
////////////////////////////////////////////////////////////////////////////

if ( !isset($ViewPerm) )
{
    if ( isset($bbuserinfo['usergroupid']) )
    {
        $mygroups = $bbuserinfo['usergroupid'];

        if ( $bbuserinfo['membergroupids'] != "" )
        {
            $mygroups .= ",".$bbuserinfo['membergroupids'];
        }
    }
    else
    {
        // vB3.5 uses $vbulletin
        $mygroups = $vbulletin->userinfo['usergroupid'];

        if ( $vbulletin->userinfo['membergroupids'] != "" )
        {
            $mygroups .= ",".$vbulletin->userinfo['membergroupids'];
        }
    }

    $grouparr = explode( ",", $mygroups );

    $resultb = mysql_query("SELECT id,ugnoview,password FROM {$pp_db_prefix}categories");
    $ViewPerm = array();

    while ( list( $catugid, $ugnoview, $catugpass ) = mysql_fetch_row($resultb) )
    {
        $noview=0;
        $ViewPerm[$catugid] = 1;

        $allnoview = explode( ",", $ugnoview );

        foreach ($allnoview as $key)
        {
            if (in_array($key, $grouparr) )
            {
                $noview = 1;
            }
        }

        if ( $noview == 0 && $catugpass == "" )
        {
            $ViewPerm[$catugid]=0;
        }
    }
}

$resultc = mysql_query("SELECT setting FROM {$pp_db_prefix}settings WHERE id=133");
list( $seotype ) = mysql_fetch_row($resultc);

$resultd = mysql_query("SELECT setting FROM {$pp_db_prefix}settings WHERE id=6");
list( $data_full ) = mysql_fetch_row($resultd);
//
// Featured Photos Code
// Follow down to End Feature Photos Code
//

switch ($q_switch)
{
    case "most_view":
        $query = "SELECT p.id,p.user,p.userid,p.cat,p.bigimage,p.title,c.catname,c.photos,c.posts
                        FROM {$pp_db_prefix}photos p
                        LEFT JOIN {$pp_db_prefix}categories c ON c.id = p.cat
                        WHERE p.storecat = 0 AND p.approved = 1 AND p.ismature = 0
 	                    ORDER BY views DESC LIMIT 25";
        break;

    case "latest":
        $query = "SELECT p.id,p.user,p.userid,p.cat,p.bigimage,p.title,c.catname,c.photos,c.posts
                        FROM {$pp_db_prefix}photos p
                        LEFT JOIN {$pp_db_prefix}categories c ON c.id = p.cat
                        WHERE p.storecat = 0 AND p.approved = 1 AND p.ismature = 0
                        ORDER BY date DESC LIMIT 25";
        break;

    default:
        $query = "SELECT p.id,p.user,p.userid,p.cat,p.bigimage,p.title,c.catname,c.photos,c.posts
                        FROM {$pp_db_prefix}photos p
                        LEFT JOIN {$pp_db_prefix}categories c ON c.id = p.cat
                        WHERE p.storecat = 0 AND p.approved = 1 AND p.ismature = 0
                        ORDER BY RAND() LIMIT 25";
}
$result = mysql_query($query) or die(mysql_error());

$counted = 0;
$countcol = 0;
$pppro_imagebits = null;

while (list($pid,$puser,$puserid,$pcat,$photo,$ptitle,$catname,$cphotos,$cposts) = mysql_fetch_row($result))
{

    if ( $seotype == "seo" )
    {
	    $seocatname = photourlsafe( $catname );
	    $ptitle = photourlsafe( $ptitle );
    }
     
    if ( photo_is_image($photo)|| photo_is_multimedia($photo) )
    {
	    if ( $ViewPerm[$pcat] == 1 )
	    {
	        continue;
	    }

	    if ( photo_is_image($photo) )
	    {
	        if ( $seotype == "seo" )
	        {
	            $plink = "<td><a href=\"{$url_path}/$catname/p{$pid}-{$ptitle}.html\"><img src=\"{$data_dir}/{$pcat}/thumbs/$photo\" border=\"0\" alt=\"\" /></a></td>";
	            $catlink = "<a href=\"{$url_path}/g{$pcat}-{$seocatname}.html\">$catname</a><br />";
	        }
	        else
	        {
	            $plink = "<td><a href=\"{$url_path}/showphoto.php?photo={$pid}\"><img src=\"{$data_dir}/{$pcat}/thumbs/$photo\" border=\"0\" alt=\"\" /></a></td>";
	            $catlink = "<a href=\"{$url_path}/showgallery.php?cat={$pcat}\">$catname</a><br />";
	        }
	    }

	    if ( photo_is_multimedia($photo) )
	    {
	        $filenoext = photo_get_filename( $photo );
	        $mmthumb = "{$data_dir}/$pcat/thumbs/$filenoext.jpg";
	        $dirthumb = "{$data_full}/$pcat/thumbs/$filenoext.jpg";

	        if ( !file_exists($dirthumb) )
	        {
	            $mmthumb = "{$url_path}/images/video.gif";
	        }

	        if ( $seotype == "seo" )
	        {
	            $plink = "<td><a href=\"{$url_path}/$catname/p{$pid}-{$ptitle}.html\"><img src=\"{$mmthumb}\" border=\"0\" alt=\"\" /></a></td>";
	            $catlink = "<a href=\"{$url_path}/g{$pcat}-{$catname}.html\">$catname</a><br />";
	        }
	        else
	        {
	            $plink = "<td><br /><a href=\"{$url_path}/showphoto.php?photo={$pid}\"><img src=\"{$mmthumb}\" border=\"0\" alt=\"\" /></a></td>";
	            $catlink = "<a href=\"{$url_path}/showgallery.php?cat={$pcat}\">$catname</a><br />";
	        }
	    }

// One box for each feature
$pppro_imagebits .= <<<PPPRINT
    <td align="center" class="alt1">
        <table cellpadding="0" cellspacing="0" border="0">
         <tr>
         $plink
         </tr>
        </table>

<font size="1" face="verdana,arial">by {$puser}<br />
? ? ?<br />
     </td>
PPPRINT;

        $counted++;
        $countcol++;
    }

    // If we've reached our limit, quit
    if ( $counted == $num_display )
    {
        break;
    }

    // If we need to end the column, do so.
    if ( $countcol == $columns )
    {
$pppro_imagebits .= <<<PPPRINT
    </tr>
    <tr>
PPPRINT;

    $countcol = 0;
    }
}
@mysql_free_result($result);

$templater = vB_Template::create('forumhome_addon');
$templater->register_page_templates();
$templater->register('pppro_imagebits', $pppro_imagebits);

$template_hook['forumhome_above_forums'] .= $templater->render();
Reply With Quote
  #15  
Old 12-20-2016, 09:03 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, so that's practically the code that's in the included file, in my case. As I said, I'm on vB3 still, but it's basically the same.

You'd just need to find out which hook to use and probably adapt the template. Since I don't have a vB4 installation handy anymore, someone else will hopefully chime in here.
Reply With Quote
  #16  
Old 12-23-2016, 08:47 AM
Phil Dart Phil Dart is offline
 
Join Date: Dec 2016
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is the hook not 'forumhome_above_forums' ?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:20 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04258 seconds
  • Memory Usage 2,259KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete