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

Pages: 1 ... 55 56 57 58 [59] 60 61 62
871
Hello
i don't have a lots of movies but i should get a information that the movie is loading!

http://www.foto-kocher.com/details.php?image_id=1070

any idee?

sincerly
vincent

872
i have been writing a message to rproctor and asked him to publish it again!
until now - no feedback!

sincerly
vincent

873
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

874
Hello
i think he would like to have the possibility to make a group of a couple of picture!
maybe he is looking for something like that http://www.foto-kocher.com/sol.php
but in my case it is done by hand in html
because i am not able to code this in php

sincerly
vincent

875
Discussion & Troubleshooting / Re: paysites
« on: March 17, 2005, 01:38:33 PM »
@cyrus
darf man deine Homepage sehen?
gruss
vincent

876
Chit Chat / Re: Missing MODs/FIXes/FAQs (Updated 16-03-2004 08:18 EST)
« on: March 17, 2005, 09:34:07 AM »
missing MOD -  but wrote a mail to rproctor - and asked to publish again  :wink:

[MOD COMPLETE] Show newest images in main cat from sub cat.

 :roll: 8)
Vincent

877
Mods & Plugins (Requests & Discussions) / Re: mod's after hack-attack
« on: March 16, 2005, 09:48:28 AM »
@insomnoid

try this link
http://www.4homepages.de/forum/index.php?topic=6787.0

sincerly
vincent

878
this is not my mod - just copied back from google
maybe you should send a message to Fugaziman

sincerly
vincent

879
directory 174 macht probleme das heisst die anderen 173 gingen zum installieren?!
was hast du modifiziert an der DB das es nicht mehr geht?

gruss
vincent

880
Mods & Plugins (Requests & Discussions) / Re: mod's after hack-attack
« on: March 15, 2005, 07:22:29 AM »
Chris
yesterday i still could find some Mods!
but i need the mod name to find it of course!
vincent

881
Hello V@no
as i know the IP code is not fixed to a country! This only should work with IP.v6

vincent

882
Mods & Plugins (Requests & Discussions) / Re: Mod for Short URL?
« on: March 14, 2005, 04:15:40 PM »
what was the mod name exactly?

vincent

883
Mods & Plugins (Requests & Discussions) / Re: mod's after hack-attack
« on: March 14, 2005, 02:27:17 PM »
if you know a missing  mod - go search by google and open the cache stored information!

i think i could publish back 5-8 Mods this way!
but i also don't know all MODs!

sincerly
vincent

885
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

Pages: 1 ... 55 56 57 58 [59] 60 61 62
Post your comments here