Welcome to Geeklog, Anonymous Tuesday, July 08 2025 @ 01:50 pm EDT
Geeklog Forums
My random picture doesnt work on 1,4 anymore
Status: offline
Forum User
Full Member
Registered: 01/02/05
Posts: 437
it use to work on 1.3.11
is there a way to fix this issue??
is there a way to fix this issue??
20
23
Quote
Status: offline
Forum User
Full Member
Registered: 12/29/04
Posts: 555
your error:
suggests that the function you use to generate this random image is no longer in your lib-custom.php
When you upgraded you probably overwrote it.
Try looking back to an older copy and copy it over. Or search geeklog for it.
Hope this helps
Error in PHP Block. Function, phpblock_rand_story_pic, does not exist.
suggests that the function you use to generate this random image is no longer in your lib-custom.php
When you upgraded you probably overwrote it.
Try looking back to an older copy and copy it over. Or search geeklog for it.
Hope this helps
17
18
Quote
Status: offline
Forum User
Full Member
Registered: 03/09/05
Posts: 242
There any way that in addition to the image and title of the article, appears as the introduction of the article?
Greetings!!
Greetings!!

18
24
Quote
Status: offline
Forum User
Full Member
Registered: 03/09/05
Posts: 242
There any way that in addition to the image and title of the article, appears as the introduction of the article?
20
18
Quote
Status: offline
Forum User
Full Member
Registered: 12/29/04
Posts: 555
If the rss feed from your site contains both the article and images from the article then that would be easy to do with jQuery.
-s
-s
28
22
Quote
Status: offline
Forum User
Full Member
Registered: 03/09/05
Posts: 242
I'm not good programming, but could you give me an example?
Greetings!!
Greetings!!

20
14
Quote
Status: offline
Forum User
Full Member
Registered: 12/29/04
Posts: 555
Text Formatted Code
<style>
#random img {
width: 100%;
max-width: 200px;
height: auto;
}
</style>
<div id="random" align="center"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script>
$(document).ready(function(){
$.get('/backend/geeklog.rss', {}, function(data){
// Store our items in an array.
var items = [];
$(data).find('item').each(function(){
items.push({
title: $(this).children('title').text(),
description: $(this).children('description').text().replace(/<script/gi, ''),
link: $(this).children('link').text()
});
});
var i = Math.floor(Math.random()*(items.length+1));
$('#random')
.append($('<a />').attr('href', items[i].link)
.append($('<img />').attr('src', $('<div />')
.append(items[i].description).find('img').attr('src'))))
.append($('<h2 />').text(items[i].title));
});
});
</script>
Example http://www.flashyourweb.com/random-image.php
23
15
Quote
Status: offline
Forum User
Full Member
Registered: 03/09/05
Posts: 242
Quote by: suprsidr
<style>
#random img {
width: 100%;
max-width: 200px;
height: auto;
}
</style>
<div id="random" align="center"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script>
$(document).ready(function(){
$.get('/backend/geeklog.rss', {}, function(data){
// Store our items in an array.
var items = [];
$(data).find('item').each(function(){
items.push({
title: $(this).children('title').text(),
description: $(this).children('description').text().replace(/<script/gi, ''),
link: $(this).children('link').text()
});
});
var i = Math.floor(Math.random()*(items.length+1));
$('#random')
.append($('<a />').attr('href', items[i].link)
.append($('<img />').attr('src', $('<div />')
.append(items[i].description).find('img').attr('src'))))
.append($('<h2 />').text(items[i].title));
});
});
</script>
Example http://www.flashyourweb.com/random-image.php
Text Formatted Code
<style>
#random img {
width: 100%;
max-width: 200px;
height: auto;
}
</style>
<div id="random" align="center"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script>
$(document).ready(function(){
$.get('/backend/geeklog.rss', {}, function(data){
// Store our items in an array.
var items = [];
$(data).find('item').each(function(){
items.push({
title: $(this).children('title').text(),
description: $(this).children('description').text().replace(/<script/gi, ''),
link: $(this).children('link').text()
});
});
var i = Math.floor(Math.random()*(items.length+1));
$('#random')
.append($('<a />').attr('href', items[i].link)
.append($('<img />').attr('src', $('<div />')
.append(items[i].description).find('img').attr('src'))))
.append($('<h2 />').text(items[i].title));
});
});
</script>
Example http://www.flashyourweb.com/random-image.php
Excellent example, but since I can do in order that equally it appears together with the image and the title, also the text of introduction of the article (introtext)
Greetings!!

22
23
Quote
Status: offline
Forum User
Full Member
Registered: 12/29/04
Posts: 555
Excellent example, but since I can do in order that equally it appears together with the image and the title, also the text of introduction of the article (introtext)
is there a question in there?
Merry Christmas
-s
19
17
Quote
Status: offline
Forum User
Full Member
Registered: 03/09/05
Posts: 242
if it is a question, if it is possible that your example may appear as the introductory text of the article, not only the image and title, but also the introduction.
Merry Christmas
Merry Christmas
20
21
Quote
Status: offline
Forum User
Full Member
Registered: 12/29/04
Posts: 555
So not a random image, but a random news block?
you could achieve similar creating a portal block.
<div id="random"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script>
$(document).ready(function(){
$.get('/backend/geeklog.rss', {}, function(data){
// Store our items in an array.
var items = [];
$(data).find('item').each(function(){
items.push({
title: $(this).children('title').text(),
description: $(this).children('description').text().replace(/<script/gi, ''),
link: $(this).children('link').text()
});
});
var i = Math.floor(Math.random()*(items.length+1));
$('#random')
.append($('<h2 />').append($('<a />').attr('href', items[i].link).text(items[i].title)))
.append($('<p />').html(items[i].description).append($('<a />').attr('href', items[i].link).text('read more...')));
});
});
</script>
I've updated the demo http://www.flashyourweb.com/random-image.php
-s
you could achieve similar creating a portal block.
Text Formatted Code
<div id="random"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script>
$(document).ready(function(){
$.get('/backend/geeklog.rss', {}, function(data){
// Store our items in an array.
var items = [];
$(data).find('item').each(function(){
items.push({
title: $(this).children('title').text(),
description: $(this).children('description').text().replace(/<script/gi, ''),
link: $(this).children('link').text()
});
});
var i = Math.floor(Math.random()*(items.length+1));
$('#random')
.append($('<h2 />').append($('<a />').attr('href', items[i].link).text(items[i].title)))
.append($('<p />').html(items[i].description).append($('<a />').attr('href', items[i].link).text('read more...')));
});
});
</script>
I've updated the demo http://www.flashyourweb.com/random-image.php
-s
20
21
Quote
Status: offline
Forum User
Full Member
Registered: 03/09/05
Posts: 242
If that does know, but .. is that too much to ask but how would that be?, in your example could be implemented?
20
19
Quote
Status: offline
Forum User
Full Member
Registered: 03/09/05
Posts: 242
excellent .. thank's ..

21
17
Quote
All times are EDT. The time is now 01:50 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content