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

Pages: 1 ... 37 38 39 40 [41]
601
Mods & Plugins (Requests & Discussions) / [MOD] Hot or Not Rating
« on: January 25, 2006, 05:16:48 PM »
MOD WORKS ONLY ON 1.7.1! - NO SUPPORT FOR NEWER VERSIONS OF 4IMAGES!


Info:
 I've searched the whole forum about any related topic, yes there are, but no working ones (for me), one is in spanish, the other is making errors, so i worked a little bit and (with the help of V@no) combine some stuff to get a working "Hor or Not" MOD. There were many requests for such a MOD, so here it is.

The MOD:
User opens detailed version of an image, instead of the rating button, he sees radio-buttons from 1 to 5 (or more if you change the rating) above the image. After clicking on a radio-button, the rating is added to the database and he will be automaticly redirected to the next image in the category (folder), if there is one.

Demo:
official version: www.hotornot.com
4images: www.zapomnime.com *user name "test", password "test"*

Required MODs
http://www.4homepages.de/forum/index.php?topic=7493.0

Changed files:
/templates/rate_form.html
/templates/details.html
/details.php

Tested on 4images 1.7.1 with Firefox & IE

--------------------------------------------------------------------------------------------------------------------------------------------------------

1.
open details.php

find:
Code: [Select]
show_image($image_row, $mode, 0, 1);
move below:
Code: [Select]
unset($next_prev_cache);
save file

2.
open details.html

find:
Code: [Select]
{image}
replace with:
Code: [Select]
{if next_image_url}<a href="{next_image_url}">{endif next_image_url}
   {if_rate_form} {rate_form} {end_if_rate_form}  {image}
{if next_image_url}</a>{endif next_image_url}
{lang_image_rating}: {image_rating} ({image_votes} {lang_votes})<img src="{template_url}/images/{rating_pic}" alt="" />

Add "<img src="{template_url}/images/{rating_pic}" alt="" />" only if you've installed Nicky's  "Star Rating MOD" http://www.4homepages.de/forum/index.php?topic=923.msg3990#msg3990 If not, delete it.

find:
Code: [Select]
{if rate_form}
<div align="center">{rate_form}</div>
 {endif rate_form}

delete it, or leave it if you want a second rate form under the image.

save file

3.
open rate_form.html

find:
Code: [Select]
<form method="post" action="{self}">
There are two ways for the next step:

a)
if you applyed fix [1.7.1] Conditional tags inside other conditional tags + {ifno ...}{endifno ...} http://www.4homepages.de/forum/index.php?topic=7493.0

replace with:
Code: [Select]
<FORM action={if next_image_url}{next_image_url}{endif next_image_url}{ifno next_image_url}{self}{endifno next_image_url}  method=post target=_top>

b)
If you haven't applied that fix

replace with:
Code: [Select]
<FORM action={if next_image_url}{next_image_url}&{endif next_image_url}{self} method=post target=_top>



find:
Code: [Select]
  <table border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td class="head1">
        <table border="0" cellspacing="0" cellpadding="3" class="row1">
          <tr>
            <td valign="bottom">
              <select name="rating" class="select">
                <option value="">--</option>
                <option value="5">5</option>
                <option value="4">4</option>
                <option value="3">3</option>
                <option value="2">2</option>
                <option value="1">1</option>
              </select>
            </td>
            <td>
              <input type="hidden" name="action" value="rateimage" />
              <input type="hidden" name="id" value="{image_id}" />
              <input type="submit" value="{rate}" class="button" name="submit" />
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>


replace with:
Code: [Select]
  <TABLE borderColor=#000000 cellSpacing=0 cellPadding=0 width=450>
    <TBODY>
      <TR vAlign=top>
        <TD align=top width="440"> <TABLE borderColor=#000000 cellSpacing=0 cellPadding=1 width="100%"  class="head2">
            <TBODY>
              <TR vAlign=top>
                <TD align=middle> <TABLE width=445 border=0>
                    <TBODY>
                      <TR>
                        <TD align=middle colSpan=3 width="445"> <b>Vote!</b></font></TD>
                      </TR>
                      <TR>
                        <TD width="62"></TD>
                        <TD align=middle width="319"> <table border="0" cellspacing="1" width="100%">
                            <tr>
                              <td align="center">1</td>
                              <td align="center">2</td>
                              <td align="center">3</td>
                              <td align="center">4</td>
                              <td align="center">5</td>
                            </tr>
                            <tr>


                              <td><input onclick=submit() type="radio" value="1" name="rating" ></td>
                              <td><input onclick=submit() type="radio" value="2" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="3" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="4" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="5" name="rating"></td>

                            </tr>

                          </table></TD>
                        <TD width="29"></TD>
                      </TR>
                      <TR>
                        <TD width="62"><FONT color=#006699 size=2><B>NOT</B></FONT></TD>
                        <TD align=middle width="319"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                            <TBODY>
                              <center><img src="{template_url}/images/hotornotback.gif" border="0" alt="" /></center>
                            </TBODY>
                          </TABLE></TD>
                        <TD width="29"><FONT color=#cc3300 size=2><B>HOT</B></FONT></TD>
                      </TR>
                    </TBODY>
                  </TABLE></TD>
              </TR>
            </TBODY>
          </TABLE></TD>
      </TR>
    </TBODY>
  </TABLE>
  <input type="hidden" name="action" value="rateimage">
  <input type="hidden" name="id" value="{image_id}">

Thats just a sample html, you have to change some details if youre using an other template or want (f.e.) a smaller box etc. Also you have to change the words "Vote!", "Hot" and "Not" above to whatever you like. If you want to have more voting options (e.g. 1 - 10) check this topic http://www.4homepages.de/forum/index.php?topic=6674.0

save file

upload the "hotornotback.gif" into your template/.../images folder. You can make one on you own in Photoshop, or just use this (for a 1 - 12 rating system):



Your done! Thanks a lot to V@no (who wrote the redirect function) and to Lavazza (Yes coffee is important when you code)  :lol:


602
Discussion & Troubleshooting / Re: Redirect question *please help*
« on: January 25, 2006, 04:09:33 AM »
its working!  :D :D

its 5 in the morning but you made my day  :lol: владелец спасибо!

603
Discussion & Troubleshooting / Re: Redirect question *please help*
« on: January 25, 2006, 02:55:07 AM »
Ok, i try to explain the error better  8)

When i replace {self} with {next_image_url} in the rate_form i get 2 different errors:

When i vote in FIREFOX, it takes me to the next image, but it dont registers the vote in the database

When i vote in IE, i get the standart IE "The Page cannot be found" error message. The page IE try to open is

Code: [Select]
http://www.ggrec.com/zapomnime2/method=post?rating=2&action=rateimage&id=339
I hope that helps  :roll: :roll:

edit: "zapomnime2" is my default 4images folder

604
Discussion & Troubleshooting / Re: Redirect question *please help*
« on: January 25, 2006, 01:04:33 AM »
Yes, as i said, i tried it and i get an 404 ( "The requested URL /xxx/method=post was not found on this server" )

Strange that getting such a "small" function to work is so difficult  :roll: :roll:
Any other ideas?

georgi

605
Discussion & Troubleshooting / Re: Lizenz
« on: January 24, 2006, 04:30:10 PM »
Quote
Eine kommerzielle Nutzung liegt grundsätzlich dann vor, wenn der Betreiber von 4images keine Privatperson, kein gemeinnütziger Verein und keine akademische Einrichtung ist.

http://www.4homepages.de/4images/licence.php

606
Discussion & Troubleshooting / Re: Redirect question *please help*
« on: January 24, 2006, 04:18:22 PM »
I thought maube i would be better if i post the whole -code what is generated for the details page.

From the source:
Code: [Select]



                <td width="1" class="bordercolor" valign="top"><img src="./templates/default/images/spacer.gif" width="1" height="1" alt="" /></td>
                <td width="18" valign="top"><img src="./templates/default/images/spacer.gif" width="18" height="18" alt="" /></td>
                <td width="450" valign="top"><br />

                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellspacing="0" cellpadding="3">

                          <tr valign="top">
                            <td class="row1">
  Предни снимки:<br />
                              <b><a href="./details.php?image_id=74" onMouseOver="a('IMG 0526');return true"
onMouseOut="b()">IMG 0526</a></b>
  <br /><a href="./details.php?image_id=74"><img src="./data/thumbnails/11/IMG_0526.JPG" border="1"></a>
  &nbsp;</td>
                            <td align="right" class="row1">
  &nbsp;Следващите снимки:<br />

                              <b><a href="./details.php?image_id=76">IMG 0529</a></b>
  <br /><a href="./details.php?image_id=76"><img src="./data/thumbnails/11/IMG_0529.JPG" border="1"></a>
  </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>


                  <b class="title">IMG 0527</b> <sup class="new">ново</sup> <img src="./templates/default/images/7.gif" alt="" />
 
                                    <div align="center">
   




<a href="./details.php?image_id=76">   
<FORM action=details.php?image_id=75 method=post target=_top>
  <TABLE borderColor=#000000 cellSpacing=0 cellPadding=0 width=450>
    <TBODY>

      <TR vAlign=top>
        <TD align=top width="440"> <TABLE borderColor=#000000 cellSpacing=0 cellPadding=1 width="100%"  class="head2clubsmain">
            <TBODY>
              <TR vAlign=top>
                <TD align=middle> <TABLE width=445 border=0>
                    <TBODY>
                      <TR>
                        <TD align=middle colSpan=3 width="445"> <b>Гласувай за тази снимка!</b></font></TD>

                      </TR>
                      <TR>
                        <TD width="62"></TD>
                        <TD align=middle width="319"> <table border="0" cellspacing="1" width="100%">
                            <tr>
                              <td align="center">1</td>
                              <td align="center">2</td>

                              <td align="center">3</td>
                              <td align="center">4</td>
                              <td align="center">5</td>
                              <td align="center">6</td>
                              <td align="center">7</td>
                              <td align="center">8</td>

                              <td align="center">9</td>
                              <td align="center">10</td>
                              <td align="center">11</td>
                              <td align="center">12</td>
                            </tr>
                            <tr>

                              <td><input onclick=submit() type="radio" value="1" name="rating" ></td>
                              <td><input onclick=submit() type="radio" value="2" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="3" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="4" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="5" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="6" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="7" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="8" name="rating"></td>

                              <td><input onclick=submit() type="radio" value="9" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="10" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="11" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="12" name="rating"></td>




                            </tr>

                          </table></TD>

                        <TD width="29"></TD>
                      </TR>
                      <TR>
                        <TD width="62"><FONT color=#006699 size=2><B>NOT</B></FONT></TD>
                        <TD align=middle width="319"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                            <TBODY>
                              <center><img src="./templates/default/images/hotornotback.gif" border="0" alt="" /></center>
                            </TBODY>

                          </TABLE></TD>
                        <TD width="29"><FONT color=#cc3300 size=2><B>HOT</B></FONT></TD>
                      </TR>
                    </TBODY>
                  </TABLE></TD>
              </TR>
            </TBODY>
          </TABLE></TD>

      </TR>
    </TBODY>
  </TABLE>
  <input type="hidden" name="action" value="rateimage">
  <input type="hidden" name="id" value="75">
</FORM>


 <!-- Template file for JPG Files -->
<img src="./data/media/11/IMG_0527.JPG" border="1" alt="IMG 0527" width="600" height="450" /><br />
</a>
Рейтинг до момента: 7.00 (1 Гласа)<img src="./templates/default/images/7.gif" alt="" />

607
Discussion & Troubleshooting / Re: Redirect question *please help*
« on: January 24, 2006, 04:12:19 PM »
It shows for example at image 75
Code: [Select]
<a href="./details.php?image_id=76">   
<FORM action=details.php?image_id=75 method=post target=_top>

... before i click on a rating option

You can access my site using username "test3" and password "1234" on http://www.zapomnime.com or http://www.ggrec.com/zapomnime2/


edit:
PS: I know about the broken link, have some problems with the footer, because i have the menue on the right side, i will fix it before my site goes ofifcially online (have to include the footer on 244 sites  :x )


608
Chit Chat / Re: [Greetings-again] - TheOracle is back.
« on: January 24, 2006, 02:03:12 PM »
Even if i'am new in this forum - i readet allmost all of the topics, so, welcome back Oracle ;) I hope the members of this forum have learned to be more gratefull, because it is indeed very bad when you work days over a great project (MOD), and at the end - nobody says even a little "thank you". Maybe most users see the the MODs as something normal, they dont think that you *Oracle,V@no etc* have a "real" life with real problems and tasks.

I hope that changes - so at this point, i want to thank you all for the MODs and for the support, only because of you i'am running one of the largest online communities in Bulgaria  :)

Georgi

609
Discussion & Troubleshooting / Re: Redirect question *please help*
« on: January 24, 2006, 12:10:28 PM »
Thank you for your help i appreciate it. So, for the first solution i get an "The requested URL /xxx/method=post was not found on this server"
. The second solution is also not working, but at least it gives me parse-errors in the lines (TheOracle, i've changed page_header.php, right?)

The really strange is that, in Firefox everything is working fine, only IE makes a problem *not the first one  :twisted:*. Maybe there is somewhere an error in my whole rate form? I"ve sentenced that Firefox is handling script errors and "strange html writing" better than IE. So this is my whole rate_forrm:

Code: [Select]
<FORM action={self} method=post target=_top>
  <TABLE borderColor=#000000 cellSpacing=0 cellPadding=0 width=450>
    <TBODY>
      <TR vAlign=top>
        <TD align=top width="440"> <TABLE borderColor=#000000 cellSpacing=0 cellPadding=1 width="100%"  class="head2clubsmain">
            <TBODY>
              <TR vAlign=top>
                <TD align=middle> <TABLE width=445 border=0>
                    <TBODY>
                      <TR>
                        <TD align=middle colSpan=3 width="445"> <b>Ãëàñóâàé çà òàçè ñíèìêà!</b></font></TD>
                      </TR>
                      <TR>
                        <TD width="62"></TD>
                        <TD align=middle width="319"> <table border="0" cellspacing="1" width="100%">
                            <tr>
                              <td align="center">1</td>
                              <td align="center">2</td>
                              <td align="center">3</td>
                              <td align="center">4</td>
                              <td align="center">5</td>
                              <td align="center">6</td>
                              <td align="center">7</td>
                              <td align="center">8</td>
                              <td align="center">9</td>
                              <td align="center">10</td>
                              <td align="center">11</td>
                              <td align="center">12</td>
                            </tr>
                            <tr>


                              <td><input onclick=submit() type="radio" value="1" name="rating" ></td>
                              <td><input onclick=submit() type="radio" value="2" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="3" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="4" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="5" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="6" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="7" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="8" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="9" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="10" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="11" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="12" name="rating"></td>




                            </tr>

                          </table></TD>
                        <TD width="29"></TD>
                      </TR>
                      <TR>
                        <TD width="62"><FONT color=#006699 size=2><B>NOT</B></FONT></TD>
                        <TD align=middle width="319"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                            <TBODY>
                              <center><img src="{template_url}/images/hotornotback.gif" border="0" alt="" /></center>
                            </TBODY>
                          </TABLE></TD>
                        <TD width="29"><FONT color=#cc3300 size=2><B>HOT</B></FONT></TD>
                      </TR>
                    </TBODY>
                  </TABLE></TD>
              </TR>
            </TBODY>
          </TABLE></TD>
      </TR>
    </TBODY>
  </TABLE>
  <input type="hidden" name="action" value="rateimage">
  <input type="hidden" name="id" value="{image_id}">
</FORM>


I'am sitting hours on searching google for an error but i can't find it. Hope you help me trough this guys, because your skills are much higher than mine :)

610
Discussion & Troubleshooting / Redirect to next image after vote *solved*
« on: January 23, 2006, 05:05:06 PM »
Hello ;)

I love 4images, i've installed over 30 MOD's and i'am glad that there are people like V@no, TheOracle & Acid, that are providing us with interesting and usefull MOD's

But i'am still a PHP newbie, and i can't get some special thing work.

Q: Is it possible to redirect the user, after he submitted a vote, to the next image in the category, if there is one? By default, it takes you again to the image you've just voted for. Any way to change this?

edit: I've searched the whole forum for "rating" and "redirect", but i don't found an answer - if there is a similiar topic please excuse :)

I'am using RadioButtons as a rate form, e.g.:

Code: [Select]
<FORM action={self} method=post target=_top>

                        <TD width="62"></TD>
                        <TD align=middle width="319"> <table border="0" cellspacing="1" width="100%">
                            <tr>
                              <td align="center">1</td>
                              <td align="center">2</td>
                            </tr>
                            <tr>

                              <td><input onclick=submit() type="radio" value="1" name="rating"></td>
                              <td><input onclick=submit() type="radio" value="2" name="rating"></td>                   
                            </tr>

                          </table></TD>

 <input type="hidden" name="action" value="rateimage">
  <input type="hidden" name="id" value="{image_id}">
</FORM>


So, thinking logically i have to use these tags:

Code: [Select]
{if next_image_url}<a href="{next_image_url}">{endif next_image_url}
{if next_image_url}</a>{endif next_image_url}

But anything i tried is not working, maybe i have to change some comang in a *.php file? This is very important for me, so i would be very happy if anyone could help me solve my problem.  :) Thanks for your time

edit2: Looks like there is a diffeerence between FIrefox and IE related to this. I put the {rate_form} before the image, like this:

Code: [Select]
{if next_image_url}<a href="{next_image_url}">{endif next_image_url}
   {rate_form} {image}
{if next_image_url}</a>{endif next_image_url}

Now, Firefox is taking me to the next image after i rate it, but IE doesn't - Please help me :)


Pages: 1 ... 37 38 39 40 [41]