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.


Topics - Trev

Pages: [1]
1
Discussion & Troubleshooting / Random Image... with Category
« on: January 28, 2009, 08:18:31 PM »
UPDATE: OOOPPPS --- I have posted this in to the Mods section, but can´t delete this out of this section. Sorry!

Message was:
Hi all, hope you are fine !

I downloaded the random-image mod and would like to know:

how can I set this up to show the category of the picture?

Here is my code:
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: random_full.php                                      *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.0 for 4images 1.6.1                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (http://www.4homepages.de/4images/lizenz.php) für       *
 *    weitere Informationen.                                              *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (http://www.4homepages.de/4images/lizenz_e.php) for further         *
 *    information.                                                        *
 *                                                                        *
 *************************************************************************/

// PATH TO YOUR 4images Gallery
define('ROOT_PATH''./4images/');

include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'includes/db_mysql.php');
include(
ROOT_PATH.'includes/constants.php');


$site_db = new Db($db_host$db_user$db_password$db_name);
function 
is_remote($file_name) {
  return (
preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i'$file_name)) ? 0;
}

$sql "SELECT COUNT(*) as total_images
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b 
        WHERE a.image_active=1 
        AND a.cat_id = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL."
        "
;
$row $site_db->query_firstrow($sql);
$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_media_file, a.image_comments 
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b 
        WHERE a.image_active=1 
        AND a.cat_id = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL.
        LIMIT 
$number, 1";
$row $site_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];

echo 
"<img src=\"".$full_src."\" height=\"125\" width=\"150\" border=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
'<font size="-2" face="Arial, Helvetica, sans-serif"><br>';

echo 
"$image_name\n";

?>

Thanks a lot

Trev

2
Discussion & Troubleshooting / Warning: Illegal offset type
« on: October 06, 2008, 10:41:34 AM »
Hi!

I´m having a problem with these failure messages:

Warning: Illegal offset type in d:\home\web34\fkev02\ftproot\www.xx-xx.de\4images\includes\functions.php on line 1172
Warning: Illegal offset type in d:\home\web34\fkev02\ftproot\www.xx-xx.de\4images\includes\functions.php on line 1175
Warning: Illegal offset type in d:\home\web34\fkev02\ftproot\www.xx-xx.de\4images\includes\functions.php on line 1172
Warning: Illegal offset type in d:\home\web34\fkev02\ftproot\www.xx-xx.de\4images\includes\functions.php on line 1175
Warning: Illegal offset type in d:\home\web34\fkev02\ftproot\www.xx-xx.de\4images\includes\functions.php on line 1172
Warning: Illegal offset type in d:\home\web34\fkev02\ftproot\www.xx-xx.de\4images\includes\functions.php on line 1175
Warning: Illegal offset type in d:\home\web34\fkev02\ftproot\www.xx-xx.de\4images\includes\functions.php on line 1108


Here is the code of my Functions.php:

Code: [Select]
  $num_subs = sizeof($visible_cat_cache);
  $sub_cat_list = "";
  $i = 1;
  foreach ($visible_cat_cache as $subcat_id) {
    if ($i <= $num_subs && $i <= $config['num_subcats']) {
      $sub_url = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$subcat_id);
[color=red] Line 1108: [/color]    $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".format_text($cat_cache[$subcat_id]['cat_name'], 2)."</a>";
      if ($i != $config['num_subcats'] && $i < $config['num_subcats'] && $i < $num_subs) {
        $sub_cat_list .= ", ";
      }
      if ($i == $config['num_subcats'] && $i < $num_subs) {
        $sub_cat_list .= " ...\n";
      }
    }
    $i++;
  }
  return $sub_cat_list;
}

function get_categories($cat_id = 0) {
  global $site_template, $site_db, $site_sess, $config, $lang;
  global $cat_cache, $cat_parent_cache, $new_image_cache, $subcat_ids;

  $cattable_width = ceil((intval($config['cat_table_width'])) / $config['cat_cells']);
  if ((substr($config['cat_table_width'],-1)) == "%") {
    $cattable_width .= "%";
  }

  if (!isset($cat_parent_cache[$cat_id])) {
    return "";
  }

  $visible_cat_cache = array();
  foreach ($cat_parent_cache[$cat_id] as $key => $val) {
    if (check_permission("auth_viewcat", $val)) {
      $visible_cat_cache[$key] = $val;
    }
  }

  if (empty($visible_cat_cache)) {
    return "";
  }

  $total = sizeof($visible_cat_cache);
  $table_columns = (intval($config['cat_cells'])) ? intval($config['cat_cells']) : 2;
  if ($total <= $table_columns) {
    $table_rows = 1;
  }
  else {
    $table_rows = $total / $table_columns;
    if ($total >= $table_columns && !is_integer($table_rows)) {
      $table_rows = intval($table_rows) + 1;
    }
  }

  $categories = "\n<table width=\"".$config['cat_table_width']."\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td valign=\"top\" width=\"".$cattable_width."\" class=\"catbgcolor\">\n";
  $categories .= "<table border=\"0\" cellpadding=\"".$config['cat_table_cellpadding']."\" cellspacing=\"".$config['cat_table_cellspacing']."\">\n";
  $count = 0;
  $count2 = 0;
  foreach ($visible_cat_cache as $key => $category_id) {
    $categories .= "<tr>\n<td valign=\"top\">\n";

    $is_new = (isset($new_image_cache[$category_id]) && $new_image_cache[$category_id] > 0) ? 1 : 0;
    $num_images = (isset($cat_cache[$category_id]['num_images'])) ? $cat_cache[$category_id]['num_images'] : 0;

    $subcat_ids = array();
    get_subcat_ids($category_id, $category_id, $cat_parent_cache);

    if (isset($subcat_ids[$category_id])) {
      foreach ($subcat_ids[$category_id] as $val) {
[color=red][font=Verdana]1172: [/font][/color]       if (isset($new_image_cache[$val]) && $new_image_cache[$val] > 0) {
          $is_new = 1;
        }
        if (isset($cat_cache[$val]['num_images'])) {
          $num_images += $cat_cache[$val]['num_images'];
        }
      }
    }


Till now it worked out fine... but what is this failure? It mus be something to do with Categories
Can someone help me?

Cheers

3
Mods & Plugins (Requests & Discussions) / Details umgehen?
« on: February 25, 2008, 12:47:02 PM »
Hallo,

ich habe den Mod (Bilder im Fenster) eingebaut und es sieht schon toll aus.
Jedoch ist es möglich aus dem Kategoriebereich (wo die Thumbnails angezeigt werden) direkt dieses Mod anzusprechen, ohne die Detailsseite aufzurufen. Daher ein Klick auf ein Thumbnail und das Fenster öffnet sich?

vIELEN dANK

4
Discussion & Troubleshooting / Postkarten URL
« on: October 16, 2007, 03:52:33 PM »
Hallo!

Wie schon in der Betreffzeile zu ersehen, benötige ich eine Antwort:

Ich möchte, dass die ecard-Funktion (ecard-Button) in eine neue Seite geladen wird (also target_blank).

Kann mir jemand helfen?

Danke!  :D

5
Mods & Plugins (Requests & Discussions) / Can someone take a look?
« on: May 16, 2006, 06:47:18 PM »
Hello...

I´ve been looking around for 4Images Mods and found something nice on

http://web.dhjh.tcc.edu.tw/~gzqbyr/phpBB/album.php

Take a look at the scroller "Photo Album". I think this is quite nice.

Does someone have an Idea, where to find that Mod?

Thanks a lot!

Trev

6
Mods & Plugins (Requests & Discussions) / Dropdown with Images
« on: July 15, 2005, 11:23:03 PM »
Hi!

Can somebody help me with this (Rate_form.html)

Code: [Select]
<form method="post" action="{self}">
  <table border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td>
        <table border="0" cellspacing="0" cellpadding="3" class="row1">
          <tr>
            <td valign="bottom">
              <select name="rating" class="select">
                <option value="">--</option>
                <option value="5">5 - Absolut Klasse! <img src="5.gif" width="74" height="18"></option>
                <option value="4">4 - Klasse</option>
                <option value="3">3 - Geht so</option>
                <option value="2">2 - Weniger gut</option>
                <option value="1">1 - Oh weia!</option>
              </select>
            </td>
            <td>
              <input type="hidden" name="action" value="rateimage" />
              <input type="hidden" name="id" value="{image_id}" />
              <input type="submit" value="{rate}" class="button" name="submit" />
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>

As you can see I tried to add an Image in the Dropdown part, but it doesn't work - the Image is not shown.
Has anyone an Idea how to manage it?

Thanks!
Trev

7
Discussion & Troubleshooting / Galerie Breite
« on: June 29, 2005, 01:21:05 PM »
Hallo,

wo kann ich einstellen wie Breit die Galerie sein soll?

Danke
T.

8
Mods & Plugins (Requests & Discussions) / Image und
« on: June 29, 2005, 01:07:23 PM »
Hi,
ich weiss, dass es im alten Forum einen Beitrag (oder MOD) gab, welches im Details eine Image verkleinert dargestellt hat und man die Möglichkeit hatte das Bild in einem neuen Fenster in Originalgrösse aufzumachen.

Kennt das jemand noch und kann mir sagen wo ich das finde?

Danke
Trev

9
Discussion & Troubleshooting / Dieses Forum
« on: June 28, 2005, 11:47:37 PM »
Hallo,

nun, es ist einfach unmöglich Fehler, Mods, Plugins oder Änderungen per Copy & Drop hier im Forum zu ändern, denn mann kann hieraus nichts kopieren!
Beispiel: http://www.4homepages.de/forum/index.php?topic=3236.0
Versucht mal, da den Code zu kopieren! Unmöglich, also alles per Hand!
Früher war das hier viel einfacher... hab heute auf 1.7.1. updated, bloss jetzt funktionieren einige Mods nicht... meine ganze Arbeit umsonst.
.. und wo sind die Beiträge des alten Forums? Wech...

So schön die Galerie ist, so schlecht ist es, wenn man etwas gebastelt hat (mit Mods hieraus).

Superschade...

T. :(

10
Hallo,

ich habe jemand, der von meiner Bildergalerie Postkarten verschickt, die bitterböse Inhalte haben. Ich habe zwei Postkarten vom Empfänger als Kopie erhalten, nachdem er sich beschwert hat.

Kann ich nichtregistrierte Benutzer das Verschicken von Postkarten sperren?

Also z.B. ich möchte nicht, dass peope@gmx.de Postkarten verschicken kann und möchte nur ihn sperren.

Geht das?

Gruss
Trev

Pages: [1]