Subject: My random picture doesnt work on 1,4 anymore

Posted on: 30/03/06 07:57pm
By: garfy

it use to work on 1.3.11

is there a way to fix this issue??


My random picture doesnt work on 1,4 anymore

Posted on: 30/03/06 09:20pm
By: suprsidr

your error:
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

Re: My random picture doesnt work on 1,4 anymore

Posted on: 22/12/11 04:40pm
By: koalasoft

There any way that in addition to the image and title of the article, appears as the introduction of the article?


Greetings!! Mr. Green

Re: My random picture doesnt work on 1,4 anymore

Posted on: 22/12/11 04:42pm
By: koalasoft

There any way that in addition to the image and title of the article, appears as the introduction of the article?

Re: My random picture doesnt work on 1,4 anymore

Posted on: 22/12/11 09:05pm
By: suprsidr

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

Re: My random picture doesnt work on 1,4 anymore

Posted on: 23/12/11 10:12am
By: koalasoft

I'm not good programming, but could you give me an example?

Greetings!! Mr. Green

Re: My random picture doesnt work on 1,4 anymore

Posted on: 23/12/11 04:19pm
By: suprsidr

PHP 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

Re: My random picture doesnt work on 1,4 anymore

Posted on: 24/12/11 01:48am
By: koalasoft

Quote by: suprsidr

PHP 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!! Mr. Green

Re: My random picture doesnt work on 1,4 anymore

Posted on: 24/12/11 05:23pm
By: suprsidr

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

Re: My random picture doesnt work on 1,4 anymore

Posted on: 25/12/11 06:32pm
By: koalasoft

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

Re: My random picture doesnt work on 1,4 anymore

Posted on: 26/12/11 12:22pm
By: suprsidr

So not a random image, but a random news block?
you could achieve similar creating a portal block.
PHP 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

Re: My random picture doesnt work on 1,4 anymore

Posted on: 26/12/11 01:21pm
By: koalasoft

If that does know, but .. is that too much to ask but how would that be?, in your example could be implemented?

Re: My random picture doesnt work on 1,4 anymore

Posted on: 26/12/11 01:28pm
By: koalasoft

excellent .. thank's .. Mr. Green

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=65830