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

Pages: [1]
1
Discussion & Troubleshooting / Re: $site_sess variable in footer
« on: December 02, 2005, 10:30:33 AM »
Well, since I installed 4images some months ago, I have been touching the code here and there so that it fits my needs. I installed some mods from the forum, but also did developments on my own for very specific needs.
So, according to what you say, I presume I probably managed to get site_sess readable from header.html (which, I am conscious about it, may lead to a security problem).
Regards.

2
Discussion & Troubleshooting / Re: $site_sess variable in footer
« on: November 29, 2005, 09:15:26 AM »
Thanks a lot V@no. This is exactly what I needed.

I had been trying to get this by touching page_header.php and didn't get it.
So, now I am curious to know which lines in the code are responsible for the fact that $site_sess is set within header.html.

Thank you.

3
Discussion & Troubleshooting / $site_sess variable in footer
« on: November 28, 2005, 05:24:51 PM »
Hello,

In my footer.html I need to use the $site_sess variable but, while it is set in header.html, it seems empty in footer.html.

For example, this code:
Code: [Select]
<? if ($site_sess->user_info['user_level']==ADMIN) { ?>
you are admin
<? } ?>
would work ok in header.html but not in footer.html, as the variable $site_sess seems to be unset.

Can anybody please tell me how to "propagate" this variable, $site_sess, so that it can be used from within footer.html?

Thank you.

4
Hello,
Two small addons to:

1) WHEN A NEW CATEGORY IS CREATED, CREATE ITS DOWNLOAD DIR
In:
admin/categories.php
   
Locate:
Code: [Select]
create_cat_folder(MEDIA_PATH."/".$cat_id, CHMOD_DIRS);   
Add after:
Code: [Select]
create_cat_folder(MEDIA_PATH."/".$cat_id."/download", CHMOD_DIRS);   

2) DOWNLOAD BIG VERSION OF IMAGE FROM LIGHTBOX:
   
In:
/download.php
   
Locate:
Code: [Select]
$file_path = MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file'];
$file_name = $image_row['image_media_file'];
   
Replace by:
Code: [Select]
$file_name = $image_row['image_media_file'];
$temp = MEDIA_PATH."/".$image_row['cat_id']."/download/".$file_name;
if( !file_exists($temp) )
$temp = MEDIA_PATH."/".$image_row['cat_id']."/".$file_name;
$file_path = $temp;
//$file_path = MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file'];
//$file_name = $image_row['image_media_file'];
   
NOTE: For those who installed the MOD "Whole/part category download" (http://www.4homepages.de/forum/index.php?topic=3479.0): You'll find the previous code twice. So replace it in both places and you will get the big version of image when you download the whole lightbox and also when you download the whole category.

Hope this helps.

Regards.

5
Mods & Plugins (Releases & Support) / Re: [MOD] Simple News Publishing
« on: September 13, 2005, 04:54:43 PM »
Hello,

I have finally got this mod to work. This is what has to be done:

1st PROBLEM: Settings for news system are not saved:
   
      SOLUTION:
      As deenee said, there is some data missing in the table "settings" for the news settings to be saved.
      This is the SQL I used to insert the lines:

         INSERT INTO `settings` VALUES ('news_home_display', '1');
         INSERT INTO `settings` VALUES ('news_nb', '2');
         INSERT INTO `settings` VALUES ('news_nb_days', '10');
         INSERT INTO `settings` VALUES ('news_cutoff', '5');
         INSERT INTO `settings` VALUES ('news_html', '0');
         INSERT INTO `settings` VALUES ('news_bbcode', '0');
         INSERT INTO `settings` VALUES ('news_bbcodeimg', '0');

      As you can see, I have assigned an initial value (the number on the right for each setting) which I thought was fine.
      So copy&paste these lines in your MySQL GUI and now from the ACP you'll be able to successfully set the news settings


2nd PROBLEM: When you click on 'Archives', no news are shown.

      SOLUTION: First, I warn you I am not an expert on 4images template system, so I may have made a mistake, but apparently the solution is working.
      
      On news.php (in 4images root directory):
      
      Delete the line:
      
Code: [Select]
"news_contents" => $comments,   
      Find:
      
Code: [Select]
$contents = $site_template->parse_template("news_show");
      Add before:
      
Code: [Select]
$site_template->register_vars(array(
  "news_contents" => $comments
));

      That's it!
   
      Regards.

6
With this type of if statement, never forget to put it like this instead :

Code: [Select]

if ($cat_cache[$cat_id]['num_images'] > 0) {


You missed the opening bracket sign. ;)

The other step is to close the if statement, with a closing bracket sign after the command has been commented out.
wrong, its not nececerly.
if you dont use {} brackets, only one line that followed after the condition statement will be used in the condition and the rest of the code will be treated as not related to the condition at all.
http://php.net/manual/en/language.control-structures.php#control-structures.if

Well, I can agree it is a good programming practice to always put between brackets code within an IF (and a a while, for, etc.), but certainly, as long as there is a single line, brackets are not necessary.

Is this with 4images v1.71 ?

Quote

$download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=page&cat_id=".$cat_id."&offset=".$offset."")."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>";


since I cannot find it from my categories.php file.

This line is in categories.php if you have installed the mod. See V@no's post (the one which started this thread).

7
Hello,
After installing this mod, when you are in a category with no images, if you click the download button you get a DB error ( DB Error: Bad SQL Query: SELECT cat_id, image_media_file, image_download_url FROM images WHERE image_active = 1 AND image_id IN () AND cat_id IN (0, 12, 14, 2, 3, 13, 15, 16, 4, 7, 8, 9, 10, 11) ).
I think if the category contains no images, download button should be hidden. Steps to get this (after having installed the mod):
1) open categories.php
2) Find
Code: [Select]
$download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=page&cat_id=".$cat_id."&offset=".$offset."")."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>";3) Add before
Code: [Select]
if ($cat_cache[$cat_id]['num_images'] > 0)That's it.
You could as well decide to show an inactive download button instead of not showing it.
BTW: Useful mod. Thanks V@no.
Regards.

8
This is my 1st post so hi to everybody.

I have been using 4images for about a month and I think it is a nice application.
I specially appreciate the contributions of community with mods and plug-ins.

And about this "New images since last visit" mod, in my opinion there is something which is missing:
The "new images" function has been changed so that -for a logged user-, it shows new images since user's last visit, then it is not coherent that the "new" sign still appears on images which are new according to "old new criteria" (new images for the last X days). Actually, "new" sign should appear only in images new since user's last visit.

Regards.

Pages: [1]