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

Pages: [1] 2
1
Discussion & Troubleshooting / Re: last commented image listing
« on: September 03, 2005, 07:35:36 PM »
sorry for asking... it was very obvious...

I have to use {br} tag inside short_comment_bit.html...

Thanks again for this excelent mod.

2
Discussion & Troubleshooting / Re: last commented image listing
« on: September 01, 2005, 04:12:14 PM »
Hello people.

Excelent mod. I have it working rigth out of the box.

But I want to ask you V@no... how do you make comments appear one aside the other? (in the example that you leave on the first page). I examined the code of that page, but I don't see anything out-of-common. I did a short_comment_bit.html where each comment is a separate table (as your example), but there in no way to make it appear as your layout. In my case, it always "renders" one  underneath the other, as if it put a
Code: [Select]
<br /> at the end of each table.

My (test) short_comment_bit.html
Code: [Select]
<table border="0" cellpadding="0" cellspacing="0" align="center">
 <tr>
  <TD valign="middle">
   <table border="0" cellpadding="0" cellspacing="5" class="bgcolor" align="left">
    <tr>
     <td>
      <table border="0" cellpadding="0" cellspacing="0" class="bordercolor">
       <tr>
        <td>
         <table border="0" cellpadding="3" cellspacing="1" width="100%">
          <tr>
           <TD width="100" height="50" align="center" colspan="2" class="catbgcolor">
            {comment_image_thumb}
           </td>
          </tr>
         </table>
        </td>
       </tr>
      </table>
     </td>
    </tr>
   </table>
  </td>
 </tr>
</table>

And the part of my "last.php" where {comment short} goes:

Code: [Select]
                  <span class="title">{site_name} - Últimos comentarios</span><br />
                  <hr size="1" />
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td class="head1" valign="top">Últimos 15 comentarios</td>
                          </tr>
                          <tr>
                            <td class="row2" valign="top"> {comments_short} </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>

It's the same layout as the main.php, but I did leave only the comments inside the main row (where categories, new images and stats goes).

Thanks in advance.
Best regards.
WR.

3
Hello again:

If you are a mid-skilled PHP coder, isn't very hard.

You should look on search.php , and change the SQL querys, by adding this after the last double quote:

Code: [Select]
($user_info['user_nudity'] == 0) ? ."AND i.image_nudity = 0" : ."";
I didn't have time to find the lines where you have to do it... I assume that you can find those by yourself. Where I put image_nudity, you should use your image table's field name for nudity control.

Hope it helps.

Best regards.
WR.




4
Thanks again V@no, you really beams honor to the title of guru.
I didn't remember the existence of the input type="image"!!!.
It's working great.

Best regards.
WR.

5
Hello again people:

Well, I'm trying to do this in a better way (server side).
So now I want to pass the user's screen width as a hidden field in a form. So, when I have that value on the server, I do the math and send the correct size image directly to the user, using phpThumb. If the user wants to download the full-size image, it just clicks on download button...
The problem is that I cannot make it work. I think that I will need a form for each thumb, so if you click on any of them, you will be always sending your screen with along with the URL.
Look what I have done (it's just a test approach, I have to use getElementbyId() function and assing the width value to the hidden field):

In functions.php, line 354 (may be other line, my functions.php is heavy modified, sorry I don't have the original code):
Code: [Select]
$thumb = "<form name=\"img".$image_id."\" \"id=\"img".$image_id."\" action=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\"><a onClick=\"document.img".$image_id.".submit()\">".$thumb."</a><input name=\"hsize\" type=\"hidden\" value=\"hola\" /></form>"
The result of this would be:

Code: [Select]
<form name="img58" id="img58" action="./details.php?image_id=58"><a onClick="document.img58.submit()"><img src="./data/thumbnails/5/IMG_0368_2.JPG" border="1" width="75" height="100" alt="ER 56" /></a><input name="hsize" type="hidden" value="hola" /></form>
As far as I can see, the link works, but it takes me directly to the homepage, instead of sending me to the action URL of the form.
I'm doing all OK?
There is another -simpliest- way to do what I want?.

Thanks in advance.
Best regards.
WR.

6
Español / Castellano / Re: Crear una nueva página en 4images
« on: August 14, 2005, 07:18:45 PM »
Gracias por tu contribución! Me vino como anillo al dedo!

Slds.
WR.

7
Hello people.

There are some GNU/GPL exif libraries on internet that allows writing exif data on a jpg (something that the exif lib that comes included in PHP can't do).

There are two:

http://pel.sourceforge.net/

http://www.ozhiker.com/electronics/pjmt/

The first one is very well documented.
Hope it helps.

Best regards.
WR.

8

Perhaps you did not required like the following way :

Code: [Select]

require (ROOT_PATH.'includes/search_utils.php');


;)

Hehehe. I was doing it with the exact same sintaxis. But PHP says that cannot redefine some functions... (may be a loop require/include?). I was requiering the file search_utils.php from functions.php, were I originally wrote the above function, that actually uses the function get_stopwords() from search_utils.php .
Now my function is inside search_utils.php , and I'am calling it from details.php. As far as I can see, all is working OK.

Thanks again anyway.

Best regards.
WR.

9
Thanks!!!! That was just what I was looking for.

The function is now:

Code: [Select]
function create_searchable_words($base) {
  $stopword_list = get_stopwords();
  $words = split(' ', $base);
  foreach ($words as $key => $word) {
  if (strlen($word) > MIN_SEARCH_KEYWORD_LENGTH && strlen($word) < MAX_SEARCH_KEYWORD_LENGTH) {
  if (!in_array($word, $stopword_list)) {
      if ($key == 0) {$final_url = $word;}
else {$final_url = $final_url." ".$word;}
}
      }
   }
  return $final_url;
}

I did have to move it to search_utils.php (because I was using a function of that file, and require was not working because some variables was overlapping). I used require on the details page, so I can call the function from there.

Thanks again TheOracle!.

Best regards.
WR.

10
Look at my tutorial:

http://www.4homepages.de/forum/index.php?topic=9148.0

If you want to show the images that contains a 0 on "nudity" field, you should see my last comment on the tut.

Best regards.
WR.

11
Hello people:

I'm making a mod to automatically make URLs to search.php to make possible searching fields by direct click on the field's value on the details page.
I added some code to make search.php to take variables from the GET array, and I did put this function to separate the indexed words from the non-indexed ones in the field value:

Code: [Select]
function create_searchable_words($base) {
  $words = split(' ', $base);
  foreach ($words as $key => $word) {
  if (strlen($word) > MIN_SEARCH_KEYWORD_LENGTH and strlen($word) < MAX_SEARCH_KEYWORD_LENGTH) {
if ($key == 0) {$final_url = $word;}
else {$final_url = $final_url." ".$word;}
}
   }
   return $final_url;
}

It's working Ok, but I have some problems with the "searchstopterms.txt" words. As you know, the words on that list aren't indexed, even if they enter in the range of MIN_SEARCH_KEYWORD_LENGTH and MAX_SEARCH_KEYWORD_LENGTH .
I think that somewhere in the code there is already a function that makes what I want: separate the searchable words from a string(as the one that I did make), plus removing the words that are at "searchstopterms.txt" from the string.
Anyone knows where it is?.

Thanks in advance.

WR.

12
Thanks again V@no!!!. It's working excellent.
And thanks for cleaning the code... I'm not very good with logics.

Best regards.
WR.

13
Hello again:

Yep... that was a mistake, thanks V@no. I fixed it now, but still don't work in IE6 (the problem was in the path of vertical images, and I'm now trying with horizontal ones, that's why it didn't make difference).

http://168.226.191.232/4images2/

It should resize images even if you are still at 1024 px. of horizontal res.

Best regards.
WR.

14
Thanks again V@no... but it still doesn't work with IE 6 (at least using WinXP SP2). I leave the code here... it works OK for Firefox so I think that the problem isn't the code itself...

Code: [Select]
<!-- Template file for JPG Files -->
<img src="{media_src}" border="1" alt="{image_name}" id="imgid{image_id}"{width_height} /><br />
<script language="JavaScript" type="text/javascript">
function get_id(id)
{
  if (document.getElementById) return document.getElementById(id);
  if (document.all && !document.getElementById) return document.all[id];
  if (document.layers) return document.layers[id];
}
function image_size(){
  var AspectRatio, FinalWidth, FinalHeight, DoResize;
  DoResize=0;
  if (screen.width < 1025) {FinalWidth = 580; DoResize=1}
  if (screen.width < 800) {FinalWidth = 480; DoResize=1}
  if ((get_id('imgid{image_id}').width > get_id('imgid{image_id}').height) && (DoResize==1))
  {
    AspectRatio = (get_id('imgid{image_id}').width / get_id('imgid{image_id}').height);
    FinalHeight = FinalWidth/AspectRatio;
    get_id('imgid{image_id}').width = FinalWidth;
    get_id('imgid{image_id}').height = FinalHeight;
  }
  if ((get_id('imgid{image_id}').width < get_id('imgid{image_id}').height) && (DoResize==1))
  {
    AspectRatio = get_id('imgid{image_id}').height / get_id('imgid{image_id}').width;
    FinalHeight = FinalWidth;
    FinalWidth = FinalHeight/AspectRatio;
    get_id('imgid{image_id}') = FinalWidth;
    get_id('imgid{image_id}').height = FinalHeight;
  }
}
image_size();
</script>

Note that the value 1025 is just for testing purposes only, the final value should be 1024 .

Any ideas?.
Best regards and thanks again for your time.
WR.

15
Thanks V@no!!!

It looks like the objects names cannot be just numbers...
It's now working OK with Firefox... but not working for IE 6. And It isn't showing any "notice bar" saying that it halted the execution of the code... it's very strange. I tried it from another PC to see if it was my computer, but no... the problem persist.

May be some internal configuration of the Sun Java VM? May be IE is taking the screen.width value from the system start and not updating the variable when I restart IE? (in both cases, my computer and the other I changed the resolution). In Mozilla, restarting it is sufficient to update the value of screen.width .

Any Ideas?

Thanks in advance.
Best regards.
WR.

PD: If anyone wants to try it... http://168.226.192.217/4images2/details.php?image_id=51

It will be on-line for a while... (until my connection drops and I have to reconnect) it's in spanish, but the navigation is the same as any 4images site.

Pages: [1] 2