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 - Vincent

Pages: 1 2 3 [4]
46
Guten Tag
ich wünsche mir für eine externe seite die möglichkeit
6 Zufallsbilder aus "einer" Katergorie mit mindesten 50 Bilder zu haben
Die Ausgewählte Kategorie sollte auch wieder via Zufall bestimmt werden!

konkret möchte ich mich ein solches begrüssung start homepage machen können
http://www.foto-kocher.com/start.htm
zurzeit ist es von Handgemacht ich möchte aber das sich die Starseite automatisch anpasst!

dabei wäre es gut wenn HTML die PHP seite aufrufen würde!

gruss
vincent

47
Mods & Plugins (Requests & Discussions) / Send lightbox by email
« on: March 31, 2005, 11:07:53 AM »
Hello

there is a mod lightbox for guest!
after this i would like to be abel to send this lightbox by email - like a contact sheet!
my wish is to send a couple of picture like this to a agent or somebody will do a lightbox and send this to be to request i price!

so the mod should:
administrator can send the content of a lightbox to everybody
Guest can send a content of the lightbox to my (the owner of the picture and the homepage)

thanks a lot for feedbacks

sincerly
vincent

48
Mods & Plugins (Requests & Discussions) / Keywords in which table
« on: March 30, 2005, 10:07:41 AM »
Hello

i would like to know where the keyword are stored in which table!

sincerly
vincent

49
Discussion & Troubleshooting / [Q] Image Date
« on: March 19, 2005, 10:00:40 AM »
Hello
i would like to know it the IPTC Date is stored in the database!
Or
ist the IPTC Date just read out everitime somebody call the detail.php

sincerly
vincent

50
Hello

i would like to show picture i have been selling!

something like this - writen in PHP
http://www.foto-kocher.com/sold2005.php

i belive it would go to create a table called soldpicture

soldpicture_date           // sold date
soldpicture_thumb_id    // connects to the thumbnail
soldpicture_agent        // agent   take of a list and show the logo
soldpicture_published   // or where Published

maybe some more fields needen?
and maybe to sort it by Year 2004 / 2005

on the homepage i would like a picture like the randomPicture but the picture of the last sold

like i have done it on my page but also just added by hand in html!

thanks for feedback and helps

sincerly
vincent

51
copy back from the google cache
-----------------
Okay I was told by a friend that this original mod was getting a bit to confusing with all the additions and improvements I made over time. So with this in mind I've replaced my original post with this one.
Hopefully it will be easier to follow (and still work ;) )


Mod - Create Latest/Archive News feature for your home page.

History: I've been asked quite a few times about the Latest News section I had on my home page and how I did it. Well it was only two HTML pages that I had to manually edit each time to add or move to the archive page. It was also formatted to fit in my site so wasn't easy to install on other 4image sites.
So I've created this quick Mod hoping that it would be helpful to others wanting this function.

What it does: Rather than creating more new tables and pages to create a whole new comment/bulletin board I cheated. This mod actually uses the exiting Comments table and pages (without any changes) to enter in your latest news.
Okay it's not rocket science but it works and gives the results required.

NOTE: Remember each time you add a latest news comment it will add a count to your total comments.
BUT remember as this is a very private category only the administrator will see the full count as other wont have access to it.

So READ THE INSTRUCTIONS BELOW FIRST to see if it's okay for you.
Take a look at my site to see what you think. Then Install this Mod if you want to.

As always before starting any Mod make backup copies of the files you are going to modify(Just in case).

Modified files:
./Index.php
./templates/your_template/home.html
./details.php

New Files:
./templates/your_template/news_comment_bit.html
./templates/your_template/archive.html

:arrow: Step 1. Create simple image to be used to as your Latest_news image as you would any other image.
You can use this one if you want http://www.newman.d2g.com/Code_help_files/Latest_News.jpg

:arrow: Step 2 Log into your sites Admin Control Panel

:arrow: Step 3 Create a New Category called something like "News Updates"and set all Permissions to "Private"

:arrow: Step 4 If you want others to add news then you can update their user settings to give them permissions to this new category.

:arrow: Step 5 Add the image you created (in step 1) to this category as you would any other image.
VERY IMPORTANT: WRITE DOWN the "image_id" value given when imported (eg 3456). I can't stress how important this is. You will need this number several times during installation of this mod. YOU HAVE BEEN WARNED

Ok! Here's were the code changes start.

:arrow: Step 6 In your templates directory CREATE NEW TEMPLATE FILE called news_comment_bit.html.

INSERT this code
Code: [Select]
<tr>
   <td class="row2" ><div align="right"><small>(Date Posted: {news_comment_date})</small></div><b>Headline: {news_comment_headline}</b></td>
</tr>
<tr>
   <td class="row1" align="left">{news_comment_text}</td>
</tr>

:arrow: Step 7 Edit index.php

Find :
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

Just BEFORE this, INSERT:
Code: [Select]
//--------------------------------------------------------
// Latest and Archive News Mod            --
//                     --
// User configurable variables            --
// You must change the first 4 variables to meet   --
// your requirements:     (see notes below)      --
//     $display_by_count            --
//     $latest_news_day               --
//     $show_news_articles            --
//     $news_image               --
//--------------------------------------------------------
  $display_by_count = "0";      // values 0 or 1 ....
                                // .... change this to 0 if display by days posted
                                // .... or 1 to display fixed number of news articles as Latest
                               
  $latest_news_days = "31";     // Number of days news displays at Latest ....
                                // .... change This to the number of days news shows as Latest
                               
  $show_news_articles = "5";    // Number of news articles to show ....
                                // .... change This to fixed number of articles to display for latest news
                               
  $news_image = "*****";          // Change This to your Latest news image id
//----------------------------------------------------

$new_news = (time() - 60 * 60 * 24 * $latest_news_days);

if ($newstype == "latestnewsall"){
    $news_type = "latestnewsall";
    }
else {
    $news_type = "latestnews";
    }

  $additional_sql = "";

  if ($news_type == "latestnews") {

    if ($display_by_count) {
        $additional_sql .= "  c.image_id = '".$news_image."'";
        $additional_sql_2 .= " LIMIT ".$show_news_articles;
    }
    else {
        $additional_sql .= " c.comment_date > '".$new_news."' AND c.image_id = '".$news_image."'";
        $additional_sql_2 .= "";
    }
  }

  else {
    $additional_sql .= " c.image_id = '".$news_image."'";
    $clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>&nbsp;/&nbsp;Archived News";
  }

  $sql = "SELECT c.comment_headline, c.comment_text, c.comment_date, c.image_id
            FROM ".COMMENTS_TABLE." c
            WHERE ".$additional_sql."
            ORDER BY c.comment_date DESC" .$additional_sql_2 ;

  $result = $site_db->query($sql);
  $num_rows = $site_db->get_numrows($result);
  $news_comment_row = array();

  while ($row = $site_db->fetch_array($result)) {
    $news_comment_row[] = $row;
  }

  $site_db->free_result($result);
   
// This is the Paging stuff
  if ($newstype == "latestnewsall") {
       
    include(ROOT_PATH.'includes/paging.php');
    $perpage = $show_news_articles;
    $link_arg = $site_sess->url(ROOT_PATH."index.php?newstype=latestnewsall");
    $getpaging = new Paging($page, $perpage, $num_rows, $link_arg);
    $offset = $getpaging->get_offset();

    $site_template->register_vars(array(
      "paging" => $getpaging->get_paging(),
      "paging_stats" => $getpaging->get_paging_stats()
    ));
     
    $sql = "SELECT c.comment_headline, c.comment_text, c.comment_date, c.image_id
            FROM ".COMMENTS_TABLE." c
            WHERE ".$additional_sql."
            ORDER BY c.comment_date DESC" .$additional_sql_2." 
            LIMIT $offset, $perpage";

          $result = $site_db->query($sql);
          $num_rows = $site_db->get_numrows($result);
          $news_comment_row = array();
           
      while ($row = $site_db->fetch_array($result)) {
            $news_comment_row[] = $row;
          }
  }

  if (!$num_rows) {
      $news_comments = "&nbsp;&nbsp;&nbsp;<b>No New News to report within the last ".$latest_news_days." days.</b>";
  }
  else {
      $news_comments = "";
      $bgcounter = 0;

    for ($i = 0; $i < $num_rows; $i++) {
        $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

        $site_template->register_vars(array(
            "news_comment_headline" => format_text($news_comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
            "news_comment_text" => format_text($news_comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
            "news_comment_date" => format_date($config['date_format']." ".$config['time_format'], $news_comment_row[$i]['comment_date']),
            "row_bg_number" => $row_bg_number));

        $news_comments .= $site_template->parse_template("news_comment_bit");
    }

  }
  $site_template->register_vars("news_comments", $news_comments);
  unset($news_comments);

//-----------------------------------------------------
//---End of Show Latest News   -------------------------------
//-----------------------------------------------------

:arrow: Step 8 at bottom of page Search for
Code: [Select]
$site_template->print_template($site_template->parse_template($main_template));
 


Replace with
Code: [Select]
if ($news_type == "latestnewsall") { 
  $site_template->print_template($site_template->parse_template(archive));     

else { 
  $site_template->print_template($site_template->parse_template($main_template)); 
}

:arrow: Step 9 In the code you just added to your Index.php you need to change the 4 variables to meet your sites requirements.

$display_by_count = "0"; Set to values 0 or 1 ....
Set to 0 (Zero) If you want to display by number of days posted
Set to 1 (One) to display a fixed number of Latest News comments.

$latest_news_days = "31"; Set to the Number of days New News comments are displayed before
moving to archive page/link

$show_news_articles = "5"; Set to a fixed number of news comments you want to display at Latest

$news_image = "*****"; Change this to your Latest news image id (eg 3421) that you got in step 5

:arrow: Step 10 Edit ./templates/your_template/home.html
Insert this code where you want the Latest News comments to display
Code: [Select]
<table width="100%" border="1" cellspacing="1" cellpadding="1">
    <tr>
        <td align="left"  class="head1" height="20" width="100%"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" /><a href="./index.php">Latest News</a></td>
    </tr>
    <tr>
        <td>
        <table width="100%" border="1" cellspacing="1" cellpadding="4">
        {news_comments}
        </table>
        </td>
    <tr>
    <tr>
        <td align="right" class="head1" height="20" width="100%"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" /><a href="./index.php?newstype=latestnewsall">News Archive</a>&nbsp;&nbsp;</td>
    </tr>
</table>

:arrow: Step 11 By default 4images only allows 1 comment per image per ip address per given time period. This is to stop your site being spammed with loads and loads of comments. For the Private Latest News image though you may want to enter 2 or 3 news comments at once so to bypass this for just your Latest News Image do this...

Edit ./details.php file
Find:
Code: [Select]
$sql = "SELECT comment_ip, comment_date
            FROM ".COMMENTS_TABLE." 
            WHERE image_id = $id 
            ORDER BY comment_date DESC 
            LIMIT 1";
    $spam_row = $site_db->query_firstrow($sql);
    $spamtime = $spam_row['comment_date'] + 180;

    if ($session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN)  {
      $msg .= (($msg != "") ? "" : "").$lang['spamming'];
      $error = 1;
    }

Replace with
Code: [Select]
if ($id != "****"){   //added for latest news mod
    $sql = "SELECT comment_ip, comment_date
            FROM ".COMMENTS_TABLE." 
            WHERE image_id = $id 
            ORDER BY comment_date DESC 
            LIMIT 1";
    $spam_row = $site_db->query_firstrow($sql);
    $spamtime = $spam_row['comment_date'] + 180;

    if ($session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN)  {
      $msg .= (($msg != "") ? "" : "").$lang['spamming'];
      $error = 1;
    }
  }

In the code you just replaced change "****" to be your Latest_News image id that you wrote down in step 5

:arrow: Step 12 Create a new template page in your templates directory to show your news archive page and allow paging of old news. I suggest making a copy of your home.html file, renaming it archive.html, edit it and removing all the stuff you don't want to display on your news archive page.

Edit archive.html and insert this code where you want the Archived News Comments Archive to appear
Code: [Select]
<table width="100%" border="1" cellspacing="1" cellpadding="1">
   <tr>
      <td align="left"  class="head1" height="20">Archived News</td>
                <td align="right" class="head1" height="20">{paging}></td>
   </tr>

   <tr>
      <td colspan="2">
         <table width="100%" border="1" cellspacing="1" cellpadding="4">
         {news_comments}
         </table>
      </td>
   </tr>
   <tr>
      <td align="left"  class="head1" height="20"> <a href="./index.php">Latest News</a></td>
      <td align="right" class="head1" height="20">{paging} </td>
   </tr>             
</table>


That's it. Now you can test it to see if it works.
1)Log into your site as your admin account.
2)Find your new Category, remember it's something like News Updates
3)Add a comment or 3 to the Latest News image you created
3)Go back to home page and see the results.

I think thats it.
I tested this documents steps fully on a fresh install of the 4images PHP pages and Default template pages. It worked fine. So if you follow the steps carefully it should work for you first time.

Thanks to Vividviews for getting on my back and making me do this re-write
Good luck with your sites Everyone.

Fugaziman
_________________
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Last edited by Fugaziman on 17.05.2003, 21:03; edited 6 times in total

52
Language Packs / [Language] turkish
« on: March 11, 2005, 08:22:52 AM »
[EDIT by Nicky]
Lang Pack for 1.7.6 attached in this post

husmen73
THX 4 update

--------------------
and this part my Help

http://www.rarsoft.com/
http://www.7-zip.org

53
Hello
i am looking for this lost MOD!
sincerly
vincent

54
Hello
i am looking for the code of the in the subject writen code!
sincerly
vincent

55
Hello
when logged into the homepage i have on the bottem a link (Control Panel)
when i finish doing something i would like to log out a (Log Out) Button/Link

how to do this?

sincerly
vincent

56
Mods & Plugins (Requests & Discussions) / Paging changes
« on: March 10, 2005, 06:59:23 PM »
Hello
bevor the hack i was looking for a possibility to show a paging system like this

<<page forward>> 1 2 3 . . . 13 14 15 . . . 31 32 33 <<Next page>>

thanks for hints
vincent

Pages: 1 2 3 [4]