Jump to content

Pages. Random Article or Quote. How to do it?


estan
 Share

Recommended Posts

Hey guys,

Before upgrading to 3.4.7 I had different functionalities that depend on the random feature - random article for the day, random quote of the day and few others. Since, we do not have such random option in Pages now, 4.0.3 version (I hope they will add it in the future versions), I need to do it manually.

As I understand it, now I need to create a custom PHP block with code that connects to the Pages database and then shows the random article. I have no idea how to do that after the migration to 4.0. I even do not know how to do the simple thing of connecting to the Pages database. And I really need this because multiple functionalities after I upgraded to 4.0.3 does not work because of not knowing how to do this random thing, and google does not play nice with long time broken pages.

I would very very much appreciate some support here. Can you please help? 
If anyone has same block code or similar one, can you post here?

 

Edited by estan
Link to comment
Share on other sites

Is it no longuer possible to use a random block, in the 4.0 ?  I need it.

​Blocks in IPB 4 are severely limited compared to how they were in IPB 3. It's a shame, but hopefully IPS will re-introduce these old IP.Content features again.

Link to comment
Share on other sites

Well, yeah, plenty of stuff to improve, but I'm so so happy with IPB 4 that it is ok. I understand that these little goodies will take some time.
I just hope that midtime I can find an acceptable solution.

So, anyone who already did this, can you post the code and help us?
Or anyone who have a bit of time to create the PHP custom block code, at least the most basic stuff - DB connection, fetching random record etc?

Please, your help is much needed and obviously not only from me :) 

Link to comment
Share on other sites

Yes and I up this topic to say that for me it's currently not possible to work with the new IP.content.

I manage a dictionnary and my definitions are sorted by alphabetic order, of course. But in french, there are a lot of accents. So a word which begins with the letter "ç" will be displayed after "z", and same way for "é", "ê", etc...

To avoid this, normaly I use a simple custom field "letter". But now, I can't do that. Can you imagine a dictionnary, without ABC ?

For me, this current version of IP.content means the end of my website. I need to go back to the 3.4.7...

 

Link to comment
Share on other sites

Why?

Because I can't use the default title field to sort the definitions. For instance, the definition "évolution" would be displayed at the end of all the definitions that begin by the letter "e" (and not at the end of the ABC, as I said above).

So I add a custom text field in the database, with the name of the definition, filled without any special character : evolution. Or "ca" instead of "ça", or "echoique" instead of "échoïque", etc... Then, I use the filter option in the blocks, to order the definitions according to that custom text field. And it works fine.

But now, it's no longer possible.

Edited by action-reaction
Link to comment
Share on other sites

Then, I use the filter option in the blocks, to order the definitions according to that custom text field. 

​I see. It still works in for the regular database listing, but not in the blocks, because custom fields don’t show up as options. Right. This is not so nice, considering it was an option before. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...