4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 20, 2014, 04:08:41 PM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [Mod] More random images, from current (same) Category, show on the Detail page
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 » »» Print
This topic has not yet been rated!
Author Topic: [Mod] More random images, from current (same) Category, show on the Detail page  (Read 8954 times)
uploadeur
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 16
-Receive: 1


View Profile
« on: February 28, 2012, 02:42:32 AM »

i need a trick(at left sidebar) which shows 5 or 10 random images from current category.

any ideas?
Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4098

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #1 on: February 28, 2012, 06:56:47 AM »

Hi!

1.) search in details.php:
1
2
//-----------------------------------------------------
//--- Clickstream -------------------------------------
insert above:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//#################### Random Images Start ########################
  
$num_random_images 5// how many Images

  
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.""user_name")."
          FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
          WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").") AND i.cat_id = $cat_id AND i.image_id not in($image_id)
          ORDER BY RAND()
          LIMIT 
$num_random_images ";
  
$result $site_db->query($sql);
  
$num_rows $site_db->get_numrows($result);

  if(!
$num_rows){
    
$random_images $site_template->parse_template("random_image");
  }
  else{
    
$random_images ="";
    while (
$image_row $site_db->fetch_array($result)){
    
$site_template->register_vars(array(
      
"rand_thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode,1),
      
"rand_image_name" => format_text($image_row['image_name'], 2),
      
"rand_user_name" => $image_row['user_name'],
      
"lang_comments" => $lang['comments'],
      
"rand_image_comments" => ($image_row['image_allow_comments'] == 1) ? $image_row['image_comments'] : "",
    ));
    
      
$random_images .= $site_template->parse_template("more_random_image");
    } 
// end while
  
// end else
  
$site_template->register_vars("random_cat_image"$random_images); 
  unset(
$random_images);
//#################### Random Images END ########################

2.) create a new flie call it "more_random_image.html" and store it in your template folder:
1
2
{rand_thumbnail}<br>{rand_image_name}{if image_is_new} <sup class="new">{lang_new}</sup>{endif image_is_new}<br>
{if allow_comments}{lang_comments} {rand_image_comments}{endif allow_comments}<br>{rand_user_name}<br><br>

3.) now you can, where ever you want, write in details.html "{random_cat_image}"


mfg Andi
« Last Edit: May 22, 2013, 05:30:14 PM by Rembrandt » Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
uploadeur
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 16
-Receive: 1


View Profile
« Reply #2 on: February 28, 2012, 12:19:39 PM »

nothing changed? Sad
Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4098

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #3 on: February 28, 2012, 01:31:23 PM »

i have test it on a another site, it works.
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
uploadeur
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 16
-Receive: 1


View Profile
« Reply #4 on: February 28, 2012, 01:33:23 PM »

i think a change must be done in details.html? maybe i dont have ''random images'' part in details.html?
« Last Edit: February 28, 2012, 02:01:10 PM by uploadeur » Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4098

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #5 on: February 28, 2012, 05:30:05 PM »

yes the mod works currently only in the categories.html.
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
uploadeur
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 16
-Receive: 1


View Profile
« Reply #6 on: February 28, 2012, 05:54:36 PM »

i need which works in details.html

here is my details.html:



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="tr" lang="tr">

      

<head>

<title>{image_name}</title>

<meta http-equiv="content-type" content="text/html; charset={charset}">

<meta name="robots" content="noodp">







<link rel="icon" href="favicon.ico" type="image/x-icon" />

<link rel="stylesheet" href="{template_url}/style.css" />






{if has_rss}

<link rel="alternate" type="application/rss+xml" title="{rss_title}" href="{rss_url}" />




{endif has_rss}







</head>

<body bgcolor="#FFFFFF" text="#0F5475" link="#0F5475" vlink="#0F5475" alink="#0F5475">



<table width="640" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>

          <td width="100%"><a href="http://www.resimupload.org"><img src="{template_url}/images/header_logo.jpg" width="840" height="140" alt="" border="0" /></a></td>




  </tr>
  <tr>
    <td class="bordercolor">
      <table width="100%" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td class="tablebgcolor">
            <table width="100%" border="0" cellspacing="1" cellpadding="0">
              <tr>
                <td class="navbar" height="23">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">






                    <tr>
                      <td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
                      <td align="right">
<a href="{url_top_images}"><b>{lang_top_images}</b></a>&nbsp;








 </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>










            <table width="638" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="150" valign="top" class="row2">
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    
        







                    
                  </table>
                  {if random_cat_image}
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1"> <br />
                        {random_cat_image} <br />













                        <br />
                      </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
                  {endif random_cat_image} </td>











                <td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
                <td width="18" valign="top"><img src="{template_url}/images/spacer.gif" width="18" height="18" alt="" /></td>
                <td width="100%" valign="top"><br />






<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="row2"> {if prev_image_name}{lang_prev_image}<br />&nbsp;&nbsp;
                              <b><a href="{prev_image_url}"><img src="http://www.resimupload.org/templates/onceki-resim.png"
 alt="" width="144" height="38" /></a></b>
                              <!-- <br><br><a href="{prev_image_url}"><img src="{prev_thumb_file}" border="1"></a> -->
                              {endif prev_image_name} </td>
 <td align="right" class="row2">  {if next_image_name}{lang_next_image}<br>
                              <b><a href="{next_image_url}"><img src="http://www.resimupload.org/templates/sonraki-resim.png" alt="" width="143" height="38" /></a></b>
                              <!-- <br><br><a href="{next_image_url}"><img src="{next_thumb_file}" border="1"></a> -->
                              {endif next_image_name}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>

<br>




                  <b class="title">{image_name}</b>{if image_is_new} <sup class="new">{lang_new}</sup>{endif
                  image_is_new}
                  <hr size="1" />
                  {if msg}<b>{msg}<br />
                  <br />
                  </b>{endif msg}
                  <div align="center">
 {image}


<p>






<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="row2"> {if prev_image_name}{lang_prev_image}<br />&nbsp;&nbsp;
                              <b><a href="{prev_image_url}"><img src="http://www.resimupload.org/templates/onceki-resim.png"
 alt="" width="144" height="38" /></a></b>
                              <!-- <br><br><a href="{prev_image_url}"><img src="{prev_thumb_file}" border="1"></a> -->
                              {endif prev_image_name} </td>
 <td align="right" class="row2">  {if next_image_name}{lang_next_image}<br>
                              <b><a href="{next_image_url}"><img src="http://www.resimupload.org/templates/sonraki-resim.png" alt="" width="143" height="38" /></a></b>
                              <!-- <br><br><a href="{next_image_url}"><img src="{next_thumb_file}" border="1"></a> -->
                              {endif next_image_name}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>

















</div>
                  
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="2">{image_name}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" width="33%"><b>{lang_description}</b></td>
                          
                         </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_date}</b></td>
                            <td valign="top" class="row1">{image_date}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"><b>{lang_hits}</b></td>
                            <td valign="top" class="row2">{image_hits}</td>
                          </tr>
                          
                          <tr>
                            <td valign="top" class="row2"><b>{lang_rating}</b></td>
                            <td valign="top" class="row2">{image_rating} ({image_votes}
                              {lang_votes})</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_file_size}</b></td>
                            <td valign="top" class="row1">{image_file_size}</td>
                          </tr>
                        
                        </table>
                      </td>
                    </tr>
                  </table>
                  
{if rate_form}
                  <br />
<div align="center">{rate_form}</div>
                  {endif rate_form}

                  <br />
                  




                  <p>&nbsp;</p>
                </td>
                <td width="20" valign="top"><img src="{template_url}/images/spacer.gif" width="19" height="19" alt="" /></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
        










      </table>
    </td>
  </tr>
</table>
{footer}


you can see there is a random image trick, i need like that who shows 5-10 random images from SAME CURRENT CATEGORY.
« Last Edit: February 28, 2012, 07:00:53 PM by uploadeur » Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4098

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #7 on: February 28, 2012, 07:37:55 PM »

where is the problem, do the same steps in the details.php as in categories.php.
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
uploadeur
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 16
-Receive: 1


View Profile
« Reply #8 on: February 28, 2012, 07:54:08 PM »

oh in details.php works like a charm! thanks, but one think, one of the random image is same as current image, i want to make ALL random. how can i?

and one more thing: veritical random images at the sidebar OK but, how about horizontal random images for the bottom of the current image?

and one serious problem occurs: when i click a thumbnail, a different image shows up, not the one that thumbnail's.
« Last Edit: February 29, 2012, 01:45:52 AM by uploadeur » Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4098

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #9 on: February 29, 2012, 08:11:37 AM »

I have made a new code above
http://www.4homepages.de/forum/index.php?topic=30549.msg160966#msg160966

now i hope it works.  Wink

mfg Andi
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
uploadeur
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 16
-Receive: 1


View Profile
« Reply #10 on: February 29, 2012, 11:13:49 AM »

works great! thanks!

i found one problem: random images shown always by current iamge name, but there are not sometimes, so i need to make self names' of random images.
« Last Edit: February 29, 2012, 05:17:38 PM by uploadeur » Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4098

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #11 on: February 29, 2012, 06:16:21 PM »

*lol* one more time:
http://www.4homepages.de/forum/index.php?topic=30549.msg160966#msg160966

Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
uploadeur
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 16
-Receive: 1


View Profile
« Reply #12 on: February 29, 2012, 06:43:21 PM »

dude, problems got bigger, now random iamges names, and after clicked names is messing. Smile
Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4098

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #13 on: February 29, 2012, 10:06:01 PM »

http://www.4homepages.de/forum/index.php?topic=30549.msg160966#msg160966

my god, I hope it works now.  Mr. Green
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
uploadeur
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 16
-Receive: 1


View Profile
« Reply #14 on: February 29, 2012, 10:14:10 PM »

dude it's working perfect right now! i guess! Razz thanks a lot!
Logged
Pages: [1] 2 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.147 seconds with 21 queries.