Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 05:15 am EST

Geeklog Forums

My random picture doesnt work on 1,4 anymore


Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
it use to work on 1.3.11

is there a way to fix this issue??

 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
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
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
There any way that in addition to the image and title of the article, appears as the introduction of the article?


Greetings!! Mr. Green
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
There any way that in addition to the image and title of the article, appears as the introduction of the article?
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
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
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
I'm not good programming, but could you give me an example?

Greetings!! Mr. Green
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
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
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
Quote by: suprsidr

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!! Mr. Green
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
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
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
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

**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
So not a random image, but a random news block?
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
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
If that does know, but .. is that too much to ask but how would that be?, in your example could be implemented?
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
excellent .. thank's .. Mr. Green
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

All times are EST. The time is now 05:15 am.

  • 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