The eAuction Support Forums
https://www.everyscript.de/cgi-bin/yabb/YaBB.pl
eAuction 1.6.1.x >> Discussion of Functions >> New Functions
https://www.everyscript.de/cgi-bin/yabb/YaBB.pl?num=1096534144

Message started by www.blitzday.com on 09/30/04 at 10:49:04

Title: New Functions
Post by www.blitzday.com on 09/30/04 at 10:49:04

Hello Dieter,

Well as you see www.blitzday.com is getting bigger by the day. I would need a few things developed and maybe they are out there but what i tried did not work.

Could you help me beat Ebay in their success?
I am totally non profit. See www.buyandsell.ie to see what i am spending my money on.

What I need urgently is:
1. A way people can mail eachother without seeing their email addresses. b.t.w. everysfot database is down for days now!
2. A second random part which shows the 4 pictures as well under the orginal if i add the same line i get duplicates inthe second row of items with pictures how do i sole that.
3. Still having issues with the time being displayed...

I have more, but the 1st and 2nd are the most urgent.
Can you help me by giving hints or tips?

Freddy

Title: Re: New Functions
Post by Dieter Werner on 09/30/04 at 13:41:57

As for the random part ...
1. go to sub disp_cat
2. search for

Code:

           @{[disp_random('pic', 4)]}<br>

3. type 8 instead of 4

Code:

           @{[disp_random('pic', 8)]}<br>

4. replace sub get_table_val with this

Code:
sub get_table_val {
   my ($option, $random_data) = @_;
   my $pic_cnt = 0;
   my $row_switch = (int(@$random_data / 2) + 1) if @$random_data > 4;
   my (
     $close_time, $image, $img_info, $title, $bids, $bid, $cat,
     $item, $row, $rowcolor, $tbl_val, $the_bid, $date, $time,
   );
   local $_;
   
     foreach (@$random_data) {
           $pic_cnt++;
           
         (
           $close_time,
           $image,
           $title,
           $bids,
           $bid,
           $cat,
           $item
         ) = split /\[\]/, $_;
         
         $img_info = qq|<img src="$config{'img_url'}/$image"@{[img_size($image, 110)]}>|
         if $option eq 'pic' and $image !~ /http\:/;
         
         $img_info = qq|<img src="$config{'icon_url'}/$config{'if_image'}" border="0">|
         if $option eq 'list' and $image =~ /\.\w{3,}/;
         
         $img_info = qq|<img src="$config{'icon_url'}/$config{'no_image'}" border="0">|
         if $option eq 'list' and $image !~ /\.\w{3,}/;
         
           $the_bid = form_currency($bid);
         ($date, $time) = form_date($close_time) if $option eq 'list';
         
           ($row, $rowcolor) = get_row_color($row);
         
$tbl_val .= <<EO_HTML if $option eq 'pic' and $#$random_data >= 0 and $row_switch and $pic_cnt == $row_switch;
       </tr>
       <tr>
EO_HTML

$tbl_val .= <<EO_HTML if $option eq 'pic' and $#$random_data >= 0;
         <td align="center" bgcolor="#FFFFFF">
           <a href="$ENV{'SCRIPT_NAME'}?action=dispitem&category=$cat&item=$item&lang=$form{'lang'}">
               $img_info<br><b>$title</b><br>Current Bid: $the_bid
           </a>
           <br>
         </td>
EO_HTML
     
$tbl_val .= <<EO_HTML if $option eq 'list' and $#$random_data >= 0;
   <tr $$rowcolor>
       <td align="center" width="30">$img_info </td>
       <td align="left" width="200" nowrap>
           <a href="$ENV{'SCRIPT_NAME'}?action=dispitem&category=$cat&item=$item&lang=$form{'lang'}">
           <font size="2">$title</font></a>
       </td>
       <td align="left" nowrap>
           <a href="$ENV{'SCRIPT_NAME'}?action=search&searchtype=items&searchstring=$cat&lang=$form{'lang'}">
           <font size="2">$category{$cat}</font></a>
       </td>
       <td align="center" nowrap>$bids</td>
       <td align="right" nowrap>$the_bid  </td>
       <td align="center" nowrap><font size="1">
           $date<br>$time</font>
       </td>
   </tr>
EO_HTML

     }
     
$tbl_val .= <<EO_HTML if $#$random_data < 0;
     <tr>
         <td colspan="6" align="center" bgcolor="$config{'colortablebody'}">
           <font face="ARIAL" size="2">$txt{'There are no items matching your request'}</font>
         </td>
     </tr>
   </table>
</div>
EO_HTML

$tbl_val .= <<EO_HTML if $option eq 'pic' and $#$random_data >= 0;
     </tr>
   </table>
</div>
EO_HTML

$tbl_val .= <<EO_HTML if $option eq 'list' and $#$random_data >= 0;
   </table>
</div>
EO_HTML
   
   return $tbl_val;
}

Title: Re: New Functions
Post by www.blitzday.com on 10/01/04 at 11:26:24

If i implement this i get a famous whit escreen , where is the bug in this new part of the sub

Title: Re: New Functions
Post by Dieter Werner on 10/01/04 at 12:45:49

All of this has been tested and it works as expected.

So try it again ...

Title: Re: New Functions
Post by www.blitzday.com on 10/01/04 at 15:17:34

Bummer, it really does not work  ??? I must have made a mess of my script, although i still get it. This seem to crash somewhere around the 3/4th part of this addon.

As soon as i change something after:
sub get_table_val {
   my ($option, $random_data) = @_;
   my $pic_cnt = 0;
   my $row_switch = (int(@$random_data / 2) + 1) if @$random_data > 4;
   my (
$close_time, $image, $img_info, $title, $bids, $bid, $cat,
$item, $row, $rowcolor, $tbl_val, $the_bid, $date, $time,
   );
   local $_;
   
foreach (@$random_data) {
 $pic_cnt++;
 
    (
 $close_time,
 $image,
 $title,
 $bids,
 $bid,
 $cat,
 $item
    ) = split /\[\]/, $_;
     
    $img_info = qq|<img src="$config{'img_url'}/$image"@{[img_size($image, 110)]}>|
    if $option eq 'pic' and $image !~ /http\:/;
     
    $img_info = qq|<img src="$config{'icon_url'}/$config{'if_image'}" border="0">|
    if $option eq 'list' and $image =~ /\.\w{3,}/;
     
    $img_info = qq|<img src="$config{'icon_url'}/$config{'no_image'}" border="0">|
    if $option eq 'list' and $image !~ /\.\w{3,}/;
     
 $the_bid = form_currency($bid);
    ($date, $time) = form_date($close_time) if $option eq 'list';
     
 ($row, $rowcolor) = get_row_color($row);
     

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxx xxxxxxxxxxxxxx

There is goes wrong.

What can I do?

Freddy

Title: Re: New Functions
Post by Dieter Werner on 10/01/04 at 15:42:36

The forum-software is adding some linefeeds ... :'(
so you have to  know what you  are doing.

For example:
$tbl_val .= <<EO_HTML if $option eq 'pic' and $#$random_data >= 0 and $row_switch and $pic_cnt == $row_switch;

must be written as single line.

I'm willing to help out everyone with code - but it's not my part to implement it too. ;)

Title: Re: New Functions
Post by www.blitzday.com on 10/01/04 at 16:06:38

If i compare this:


$tbl_val .= <<EO_HTML if $option eq 'pic' and $#$random_data >= 0;
         <td align="center" bgcolor="#ffffff">
           <a href="$ENV{'SCRIPT_NAME'}?action=dispitem&category=$cat&item=$item&lang=$form{'lang'}">
               $img_info<br><b>$title</b><br>Current Bid: $the_bid
           </a>
           <br>
         </td>
EO_HTML
     
$tbl_val .= <<EO_HTML if $option eq 'list' and $#$random_data >= 0;
   <tr $$rowcolor>
       <td align="center" width="30">$img_info </td>
       <td align="left" width="200" nowrap>
           <a href="$ENV{'SCRIPT_NAME'}?action=dispitem&category=$cat&item=$item&lang=$form{'lang'}">
           <font size="2">$title</font></a>
       </td>
       <td align="left" nowrap>
           <a href="$ENV{'SCRIPT_NAME'}?action=search&searchtype=items&searchstring=$cat&lang=$form{'lang'}">
           <font size="2">$category{$cat}</font></a>
       </td>
       <td align="center" nowrap>$bids</td>
       <td align="right" nowrap>$the_bid&nbsp;&nbsp;</td>
       <td align="center" nowrap><font size="1">
           $date<br>$time</font>
       </td>
   </tr>
EO_HTML



with:

$tbl_val .= <<EO_HTML if $option eq 'pic' and $#$random_data >= 0 and $row_switch and $pic_cnt == $row_switch;
  </tr>
  <tr>
EO_HTML

$tbl_val .= <<EO_HTML if $option eq 'pic' and $#$random_data >= 0;
    <td align="center" bgcolor="#FFFFFF">
 <a href="$ENV{'SCRIPT_NAME'}?action=dispitem&category=$cat&item=$item&lang= $form{'lang'}">
     $img_info<br><b>$title</b><br>Current Bid: $the_bid
 </a>
 <br>
    </td>
EO_HTML

It looks if there is the issue. I tried all as one line and that did not change anything, sorry can give me one last hint? before i give up?

Title: Re: New Functions
Post by Dieter Werner on 10/01/04 at 16:54:57

I can't see any bug - but I will check it again ...

The eAuction Support Forums » Powered by YaBB 2.2!
YaBB © 2000-2007. All Rights Reserved.