hello
requests random pic for invision board please
thk
sorry is french
/ **************************************************
***********
Random Images 4images Gallery To Portal 3.2( Integration 4images 1.7 to IBF 1.1)
Hack By Best4You
/ **************************************************
***********
You have install mod Integration 4images 1.7 to IBF 1.1
///////////////////////////////////////////////////////////////////
======================================================================
Open sources/portal.php
Find :
===============================================================
$this->data['welcomepanel'] = $this->do_welcomepanel();
================================================================
Add After :
================================================
$this->data['randompic'] .= $this->randompic();
=============================================================
Find :
#=========================================================================
//*********************************************/
// Show Calendar Events (code from IBF)
//*********************************************/
function do_calendar_events() {
#==============================================================
Add Before:
#===================================================================================
//*********************************************/
// Random Pic To Portal Hack By Best4You
//*********************************************/
function randompic()
{
global $DB, $ibforums, $std;
// Set here the URL to your 4images Gallery. WITH trailing slash!
define('SCRIPT_URL', '
http://your Url/4images/');
// Set here your THUMBNAIL directory. Normally no need to change. WITHOUT trailing slash!
define('THUMB_DIR', 'data/thumbnails');
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// In following queries CHANGE 4images table PREFIX if it doesn't match (Standard "4images_")!
$sql = "SELECT COUNT(*) as total_images
FROM 4images_images a, 4images_categories b
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND b.auth_viewcat=0
AND b.auth_viewimage=0
";
if ( !($result = $DB->query($sql)) )
{
return false;
}
$row = $DB->fetch_row($result);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM 4images_images a, 4images_categories b
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND b.auth_viewcat=0
AND b.auth_viewimage=0
LIMIT $number, 1";
if ( !($result = $DB->query($sql)) )
{
return false;
}
$row = $DB->fetch_row($result);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
$ranpic = "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br />Image Name: $image_name<br />Comments: $image_comments\n";
if ($ibforums->vars['portal_randompic']) return $this->html->randompic($ranpic);
else return '';
}
// **************************************************
==================================================================++
*
Save sources/portal.php
///////////////////////////////////////////////////////////////////
==============================================================================
Open Skin/*x/skin_portal.php
===========================
Find :
=====================================
class skin_portal {
============================================
Add After :
====================================================
// Random Pic Hack by Best4You
function randompic($data) {
global $ibforums;
return <<<EOF
<table cellpadding='0' cellspacing='0' border='0' width='100%' bgcolor='<{tbl_border}>' align='center'>
<tr>
<td>
<table cellpadding='4' cellspacing='1' border='0' width='100%'>
<tr>
<td colspan='2' class='maintitle' background='{$ibforums->vars['img_url']}/tile_sub.gif'><b>Random Picture</b></td>
</tr>
<tr>
<td class='forum2' colspan='2'><center> {$data}</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
EOF;
}
//**********************************************
)=====================================================================
Find :
==========================
{$data['new_posts']}
==================================
Add Before:
=========================================
{$data['randompic']}
===================================
Save Skin/*x/skin_portal.php
///////////////////////////////////////////////////////////////////
Open souces/admin/ad_settings.php
Find :
==============================================================
'portal_member_moment', 'portal_welcomepanel', 'portal_tease_news', 'portal_tease_length','portal_calendar_events') );
================================================
Change To :
==========================================================
'portal_randompic','portal_member_moment', 'portal_welcomepanel', 'portal_tease_news', 'portal_tease_length','portal_calendar_events') );
=================================================================
Find :
==============================
$ADMIN->html .= $SKIN->add_td_row( array( "<b>Show Google Searchbar?</b>" ,
$SKIN->form_yes_no( "portal_googlebar", $INFO['portal_googlebar'] )
) );
==============================
Add After
========================================
$ADMIN->html .= $SKIN->add_td_row( array( "<b>Show Random Pic?</b>" ,
$SKIN->form_yes_no( "portal_randompic", $INFO['portal_randompic'] )
) );
=================================================
Save souces/admin/ad_settings.php
Now Go to Admin CP
Open the Category 'Basic Config', and edit your portal
within the section 'portal'.
see "Show Random Pic?"
Done!
Have Fun
===============================================================================
If you haven't this MOD ( show Calndar here !
//*********************************************/
// Show Calendar Events (code from IBF)
//*********************************************/
function do_calendar_events() {
You can make it befor this code :
====================================================================================
//*********************************************/
// Top 10: Posters
//*********************************************/
=========================================
Here is Demo :
http://ardent2in1.net/diendan/index.php