Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hybridtuning

Pages: [1]
1
Here is the showvotes.php file i saved this in my root directory

Code: [Select]

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File&#58; index.php                                            *
 *        Copyright&#58; &#40;C&#41; 2002 Jan Sorgalla                                *
 *            Email&#58; jan@4homepages.de                                    *
 *              Web&#58; http&#58;//www.4homepages.de                             *
 *    Scriptversion&#58; 1.6.1                                                *
 *                                                                        *
 *    Never released without support from&#58; Nicky &#40;http&#58;//www.nicky.net&#41;   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen &#40;Lizenz.txt&#41; für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    &#40;Licence.txt&#41; for further information.                              *
 *                                                                        *
 *************************************************************************/
$templates_used 'thumbnail_bit2';
$main_template 'votes';
define&#40;'GET_CACHES', 1&#41;;
define&#40;'ROOT_PATH', 'gallery/'&#41;;
define&#40;'GET_USER_ONLINE', 1&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
require&#40;ROOT_PATH.'includes/sessions.php'&#41;;

$user_access get_permission&#40;&#41;;

if &#40;isset&#40;$HTTP_GET_VARS['template'&#93;&#41; || isset&#40;$HTTP_POST_VARS['template'&#93;&#41;&#41; &#123;
  
$template = &#40;isset&#40;$HTTP_GET_VARS['template'&#93;&#41;&#41; ? stripslashes&#40;trim&#40;$HTTP_GET_VARS['template'&#93;&#41;&#41; &#58; stripslashes&#40;trim&#40;$HTTP_POST_VARS['template'&#93;&#41;&#41;;
  
if &#40;!file_exists&#40;TEMPLATE_PATH."/".$template.".".$site_template->template_extension&#41;&#41; &#123;
    
$template "";
  &
#125;
  
else &#123;
    
$main_template $template;
  &
#125;
&#125;
else &#123;
  
$template "";
&
#125;


if &#40;!empty&#40;$template&#41;&#41; &#123;
  
$clickstream "<a href=\"".$site_sess->url&#40;ROOT_PATH."index.php"&#41;."\">".$lang['home'&#93;."</a>".$config['category_separator'&#93;.str_replace&#40;"_", " ", ucfirst&#40;$template&#41;&#41;;
  
$site_template->register_vars&#40;"clickstream", $clickstream&#41;;
  
$site_template->print_template&#40;$site_template->parse_template&#40;$main_template&#41;&#41;;

&#125;



//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
$imgtable_width ceil&#40;intval&#40;$config['image_table_width'&#93;&#41; / $config['image_cells'&#93;&#41;;
if &#40;&#40;substr&#40;$config['image_table_width'&#93;, -1&#41;&#41; == "%"&#41; &#123;
  
$imgtable_width .= "%";
&
#125;

$cat_id_sql 0;
foreach &
#40;$cat_cache as $key => $val&#41; &#123;
  
if &#40;!check_permission&#40;"auth_viewcat", $key&#41;&#41; &#123;
    
$cat_id_sql .= ", ".$key;
  &
#125;
&#125;

$additional_sql "";
if &
#40;!empty&#40;$additional_image_fields&#41;&#41; &#123;
  
foreach &#40;$additional_image_fields as $key => $val&#41; &#123;
    
$additional_sql .= ", i.".$key;
  &
#125;
&#125;

$num_new_images $config['image_cells'&#93;;
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", u.user_name, c.cat_name 
        FROM "
.IMAGES_TABLE." i,  ".USERS_TABLE." u,  ".CATEGORIES_TABLE." c 
        WHERE i.image_active = 1 AND u.user_id = i.user_id AND c.cat_id = i.cat_id AND i.cat_id NOT IN &#40;
$cat_id_sql&#41; 
        ORDER BY i.image_votes DESC 
        LIMIT 
$num_new_images";
$result $site_db->query&#40;$sql&#41;;
$num_rows $site_db->get_numrows&#40;$result&#41;;

if &#40;!$num_rows&#41;  &#123;
  
$new_images "<table width=\"".$config['image_table_width'&#93;."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding'&#93;."\" cellspacing=\"".$config['image_table_cellspacing'&#93;."\"><tr class=\"imagerow1\"><td>";
  
$new_images .= $lang['no_new_images'&#93;;
  
$new_images .= "</td></tr></table>";
&
#125;
else  &#123;
  
$new_images "<table width=\"".$config['image_table_width'&#93;."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding'&#93;."\" cellspacing=\"".$config['image_table_cellspacing'&#93;."\">";
  
$count 0;
  
$bgcounter 0;
  while &
#40;$image_row = $site_db->fetch_array&#40;$result&#41;&#41;&#123;
    
if &#40;$count == 0&#41; &#123;
      
$row_bg_number = &#40;$bgcounter++ % 2 == 0&#41; ? 1 &#58; 2;
      
$new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    &
#125;
    
$new_images .= "<td width=\"".$imgtable_width."\" valign=\"bottom\">\n";

    
show_image&#40;$image_row&#41;;
    
$new_images .= $site_template->parse_template&#40;"thumbnail_bit2"&#41;;
    
$new_images .= "\n</td>\n";
    
$count++;
    if &
#40;$count == $config['image_cells'&#93;&#41; &#123;
      
$new_images .= "</tr>\n";
      
$count 0;
    &
#125;
  
&#125; // end while

  
if &#40;$count > 0&#41;  &#123;
    
$leftover = &#40;$config['image_cells'&#93; - $count&#41;;
    
if &#40;$leftover >= 1&#41; &#123;
      
for &#40;$f = 0; $f < $leftover; $f++&#41; &#123;
        
$new_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;</td>\n";
      &
#125;
      
$new_images .= "</tr>\n";
    &
#125;
  
&#125;
  
$new_images .= "</table>\n";
&
#125; // end else

$site_template->register_vars&#40;"new_images", $new_images&#41;;
unset&#40;$new_images&#41;;

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars&#40;array&#40;
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_rating" => $lang['rating'&#93;,
  
"lang_votes" => $lang['votes'&#93;
&#41;&#41;;
$site_template->print_template&#40;$site_template->parse_template&#40;$main_template&#41;&#41;;

?>




here is the template (thumbnail_bit2) which has to be saved into the template directory of 4images

Code: [Select]

<script language="JavaScript" type="text/javascript">
<!--
  function opendetailwindow() {
    window.open('','detailwindow','toolbar=yes,scrollbars=yes,resizable=yes,width=700,height=500');
  }
 
  function right(e) {
    if (navigator.appName == 'Netscape' && (e.which == 2 || e.which == 3)) {
      alert('© Copyright by {site_name}');
      return false;
    }
    else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button == 3)) {
      alert('© Copyright by {site_name}');
      return false;
    }
    return true;
  }
  document.onmousedown=right;
  if (document.layers) window.captureEvents(Event.MOUSEDOWN);
  window.onmousedown=right;
// -->
</script>
<script language="JavaScript">

<!--
function reqWin(desktopURL){
        desktop =window.open(desktopURL,"name","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=700,height=500,resizable=yes");
        }
// -->

</script>
<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
<style>
a { color:#666666; text-decoration:none; } /* Link Defaults: Dark Blue, Gray Hover */
a:link { color:#666666; font size:10;}
a:visited { color:#666666; }
a:hover { background-color:#eeeeee; color:#FF6600; }
a img { border:none; }
</style>
<table width="100" height="100" border="0" cellpadding="5" cellspacing="0">
<tr>
    <td width="100" height="100" align="center" valign="middle" bgcolor="#F3F3F3">{thumbnail_openwindow}</td>
  </tr>
  <tr>
    <td height="10" align="center" valign="middle" bgcolor="#F3F3F3"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Rating
      {image_rating}{image_votes}</font></td>
  </tr>
</table>



i used a iframe on my index.php to include the showvotes.php, and thats it..

-T

2
Mods & Plugins (Requests & Discussions) / working but
« on: August 17, 2002, 07:07:10 AM »
i got it working using a iframe on the homepage.. and doing the popup thumbnails.. heres is another questions.. how can I display the number of votes?

http://www.hybridtuning.com
-Toby
info@hybridtuning.com

3
Mods & Plugins (Requests & Discussions) / here is the code that i have
« on: August 16, 2002, 06:48:57 PM »
Code: [Select]

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File&#58; index.php                                            *
 *        Copyright&#58; &#40;C&#41; 2002 Jan Sorgalla                                *
 *            Email&#58; jan@4homepages.de                                    *
 *              Web&#58; http&#58;//www.4homepages.de                             *
 *    Scriptversion&#58; 1.6.1                                                *
 *                                                                        *
 *    Never released without support from&#58; Nicky &#40;http&#58;//www.nicky.net&#41;   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen &#40;Lizenz.txt&#41; für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    &#40;Licence.txt&#41; for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'votes';
define&#40;'ROOT_PATH', 'gallery/'&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
require&#40;ROOT_PATH.'includes/sessions.php'&#41;;



if &#40;isset&#40;$HTTP_GET_VARS['template'&#93;&#41; || isset&#40;$HTTP_POST_VARS['template'&#93;&#41;&#41; &#123;
  
$template = &#40;isset&#40;$HTTP_GET_VARS['template'&#93;&#41;&#41; ? stripslashes&#40;trim&#40;$HTTP_GET_VARS['template'&#93;&#41;&#41; &#58; stripslashes&#40;trim&#40;$HTTP_POST_VARS['template'&#93;&#41;&#41;;
  
if &#40;!file_exists&#40;TEMPLATE_PATH."/".$template.".".$site_template->template_extension&#41;&#41; &#123;
    
$template "";
  &
#125;
  
else &#123;
    
$main_template $template;
  &
#125;
&#125;
else &#123;
  
$template "";
&
#125;

if &#40;!empty&#40;$template&#41;&#41; &#123;
  
$clickstream "<a href=\"".$site_sess->url&#40;ROOT_PATH."index.php"&#41;."\">".$lang['home'&#93;."</a>".$config['category_separator'&#93;.str_replace&#40;"_", " ", ucfirst&#40;$template&#41;&#41;;
  
$site_template->register_vars&#40;"clickstream", $clickstream&#41;;
  
$site_template->print_template&#40;$site_template->parse_template&#40;$main_template&#41;&#41;;

&#125;



//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
$top_votes_max=2;
$imgtable_width ceil&#40;intval&#40;$config['image_table_width'&#93;&#41; / $config['image_cells'&#93;&#41;;
if &#40;&#40;substr&#40;$config['image_table_width'&#93;, -1&#41;&#41; == "%"&#41; &#123;
  
$imgtable_width .= "%";
&
#125;

$cat_id_sql 0;
foreach &
#40;$cat_cache as $key => $val&#41; &#123;
  
if &#40;!check_permission&#40;"auth_viewcat", $key&#41;&#41; &#123;
    
$cat_id_sql .= ", ".$key;
  &
#125;
&#125;

$additional_sql "";
if &
#40;!empty&#40;$additional_image_fields&#41;&#41; &#123;
  
foreach &#40;$additional_image_fields as $key => $val&#41; &#123;
    
$additional_sql .= ", i.".$key;
  &
#125;
&#125;

$num_new_images $config['image_cells'&#93;;
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", u.user_name, c.cat_name 
        FROM "
.IMAGES_TABLE." i,  ".USERS_TABLE." u,  ".CATEGORIES_TABLE." c 
        WHERE i.image_active = 1 AND u.user_id = i.user_id AND c.cat_id = i.cat_id AND i.cat_id NOT IN &#40;
$cat_id_sql&#41; 
        ORDER BY i.image_votes DESC 
        LIMIT 
$num_new_images";
$result $site_db->query&#40;$sql&#41;;
$num_rows $site_db->get_numrows&#40;$result&#41;;

if &#40;!$num_rows&#41;  &#123;
  
$new_images "<table width=\"".$config['image_table_width'&#93;."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding'&#93;."\" cellspacing=\"".$config['image_table_cellspacing'&#93;."\"><tr class=\"imagerow1\"><td>";
  
$new_images .= $lang['no_new_images'&#93;;
  
$new_images .= "</td></tr></table>";
&
#125;
else  &#123;
  
$new_images "<table width=\"".$config['image_table_width'&#93;."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding'&#93;."\" cellspacing=\"".$config['image_table_cellspacing'&#93;."\">";
  
$count 0;
  
$bgcounter 0;
  while &
#40;$image_row = $site_db->fetch_array&#40;$result&#41;&#41;&#123;
    
if &#40;$count == 0&#41; &#123;
      
$row_bg_number = &#40;$bgcounter++ % 2 == 0&#41; ? 1 &#58; 2;
      
$new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    &
#125;
    
$new_images .= "<td width=\"".$imgtable_width."\" valign=\"bottom\">\n";

    
show_image&#40;$image_row&#41;;
    
$new_images .= $site_template->parse_template&#40;"thumbnail_bit2"&#41;;
    
$new_images .= "\n</td>\n";
    
$count++;
    if &
#40;$count == $config['image_cells'&#93;&#41; &#123;
      
$new_images .= "</tr>\n";
      
$count 0;
    &
#125;
  
&#125; // end while

  
if &#40;$count > 0&#41;  &#123;
    
$leftover = &#40;$config['image_cells'&#93; - $count&#41;;
    
if &#40;$leftover >= 1&#41; &#123;
      
for &#40;$f = 0; $f < $leftover; $f++&#41; &#123;
        
$new_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;</td>\n";
      &
#125;
      
$new_images .= "</tr>\n";
    &
#125;
  
&#125;
  
$new_images .= "</table>\n";
&
#125; // end else

$site_template->register_vars&#40;"new_images", $new_images&#41;;
unset&#40;$new_images&#41;;

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars&#40;array&#40;
  
"msg" => $msg,
  
"clickstream" => $clickstream
&#41;&#41;;
$site_template->print_template&#40;$site_template->parse_template&#40;$main_template&#41;&#41;;

?>


4
Mods & Plugins (Requests & Discussions) / got it but
« on: August 16, 2002, 08:17:54 AM »
got it to work but not i got this error

Code: [Select]

Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/hybridtuning.com/httpdocs/index2.php:8) in /usr/local/plesk/apache/vhosts/hybridtuning.com/httpdocs/gallery/includes/sessions.php on line 52

Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/hybridtuning.com/httpdocs/index2.php:8) in /usr/local/plesk/apache/vhosts/hybridtuning.com/httpdocs/gallery/includes/sessions.php on line 52

Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/hybridtuning.com/httpdocs/index2.php:8) in /usr/local/plesk/apache/vhosts/hybridtuning.com/httpdocs/gallery/includes/sessions.php on line 52


the voteing images are a include page and so is the random on the left.
you can see it at

http://www.hybridtuning.com/index2.php

5
Mods & Plugins (Requests & Discussions) / ok
« on: August 16, 2002, 01:09:59 AM »
ok i got it to work.. but becuase i have the radom image and the top voted images now on the homepage i get an error about loading the header, and a db error on the radom part.. any suggestions? and how can it display the # of votes ?

http://www.hybridtuning.com/test.php

6
Mods & Plugins (Requests & Discussions) / Not Sure
« on: August 16, 2002, 12:41:28 AM »
Well I want this on the homepage of my site not the homepage of 4images? is that possable?

7
Mods & Plugins (Requests & Discussions) / great
« on: August 15, 2002, 10:56:12 PM »
thats great!!! i will await for the code, or you can email me at info@hybridtuning.com

thank you

-toby

8
Mods & Plugins (Requests & Discussions) / guess not
« on: August 15, 2002, 08:15:54 AM »
guess this isnt possable.. i tried a few things but i could not get it to work, i do have the radom image on the homepage, but i cat seem to get the top voted images to work

9
has anyone done this or is it possable?

Seeing the top 3-5 images by votes on my homepage, (the image and the number of votes) than the user can click on the image and it takes them to that image in the 4images section ?

-T

10
Mods & Plugins (Requests & Discussions) / waithing game than
« on: August 07, 2002, 07:31:27 PM »
guess I will have to sit back and wait than..

11
Mods & Plugins (Requests & Discussions) / ANYONE there yet
« on: August 07, 2002, 06:23:53 PM »
has anyone been able to get this done?

12
what should i log into?

13
ok my auto-thumbnail and image resizer stoped working.. im not sure what happend i get an error every time now.. it work until 2 days ago..

anyone have this problem before????????

-Toby
info@hybridtuning.com

Pages: [1]