HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Block names

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#25915 (In Topic #6055)
Avatar

Community saint

LO

Silly question(s) concerning blocks:

"active topics in General Chat"
Need to change the name (doesn't look good in french) and the destination forum.
Found block main_forum_topics.php

Line 44 was

Code

$info['cache_on']='array(array_key_exists(\'param\',$map)?$map[\'param\']:\'General Chat'\',array_key_exists(\'limit\',$map)?$map[\'limit\']:6)';
Changed it to

Code

$info['cache_on']='array(array_key_exists(\'param\',$map)?$map[\'param\']:\'Le Lounge\',array_key_exists(\'limit\',$map)?$map[\'limit\']:6)';

Line 63 was

Code

$forum_name=array_key_exists('param',$map)?$map['param']:'General Chat';
changed it to

Code

$forum_name=array_key_exists('param',$map)?$map['param']:'Le Lounge';
And went to add test posts in two of "Le Lounge" subforums.

The block on my start page now has the right name (Le Lounge), but says "There are currently no topics in this forum".

I noticed on the original install, "general chat" is a forum of the "general" category. On mine, Le Lounge is a category. Could that be it?
Only put one test post in forums, is it to few to be considered "active"?
Forum is phpBB. Is it compatible?

php and accented characters or apostrophes
When editing a php file like this one, what will happen if the new text includes apostrophes and accented characters?

www.precorp.fr

Last one to leave the country, please turn off the lights.
Back to the top
 
Posted
Rating:
#25922
Avatar

Community saint

I did some thing a bit different.
To pull from more then one forum I added the name of every forum to the peramiter, to change the name of the block I set the last forum it was pulling from as the name I wanted even though there is not a forum called that it still worked.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#25947
Avatar

Right, a few issues here…

1) You can pass in your forum name as a block parameter. 'General Chat' is only the default for if no parameter is given.

2) phpBB doesn't know of ocPortal being there, so can't notify it to automatically decache the block. Therefore the block is set to decache every 10 minutes – i.e. you need to wait, on average, 5 minutes to see it change.

3) To include an apostophe between some surrounding apostrophes in PHP you would say:

Code

'here\'s an example'
In other words you place a preceeding slash.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#25949
Avatar

Community saint

Part of the was a repeat of what I said so I feel good about that.
I did not change the php file to get it to pull data or posts from more then one forum.
I just put all the forums in the peramitors and set the last one for what I wanted in the block title.
The block now has a long name as it pulls from every forum on my forum, but hey it works.

EDIT: This is my block for active topics.

Code

[block="OC Power News, OC Power feed back, General Discussion, ocPortal support, Invision Power Board support, SMF support, OC Power skins support, ocPortal comment topics, Forums"]main_forum_topics[/block]

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#25962
Avatar

Community saint

LO Chris  ;)

1/ Can confirm Amy's trick works fine.

2/ As far as I'm concerned 5 minutes average to see the changes is more than acceptable. This block is there to give an idea of what's happening. Those who want the live thing can go on the forum, it's only one click away… I'm even surprised it works, wasn't really expecting this block to be usable without ocf.

3/ Thx for the apostrophe. Accented characters are not a problem then ?

www.precorp.fr

Last one to leave the country, please turn off the lights.
Back to the top
 
Posted
Rating:
#25965
Avatar

Accented characters are not a problem then ?

We could get in a long technical discussion about that ;). Basically text files are just a bunch of numbers at the core, and it's up to the program that reads them to interpret them according to some kind of scheme. As long as the character set that is used in your final web pages ('charset' in global.ini) supports the accented characters at the same code numbers as the text document assumes, it'll be fine. The French ones are very common and included in the normal western character sets.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#25970
Avatar

Community saint

The French ones are very common…
 :devil:

www.precorp.fr

Last one to leave the country, please turn off the lights.
Back to the top
 
Posted
Rating:
#35291
Avatar

Fan in action

My apologies for resurrecting this old thread, but I am having the same issue.  I cannot get my Active Forum Topics block to display posts from my Forum (its says "No Active Topics in this Forum".  I was able to change the Block name, but not the source it is displaying from.  I have waited for the cache to reset, but still no luck.  Can anybody help?  Thanks,

Kelli
Back to the top
 
Posted
Rating:
#35293
Avatar

Community saint

Hi kelli
The Active Forum Topics block must include parameters if you want it to do what you want.
i.e.

Code

[block="General chat, the forums"]main_forum_topics[/block]
will display:
Active topics in the forums, and get the posts from the General chat forum.

I may be wrong, but my understanding of it is just list the forums you want it to retrieve the posts from between " ", and the last one in the list is the name used on the block title (doesn't have to exist, can name it what you like).

www.precorp.fr

Last one to leave the country, please turn off the lights.
Back to the top
 
Posted
Rating:
#35295
Avatar

Fan in action

I can't figure out how to edit in comcode… when I download a .php file to modify, it is in regular html code.  Is there a place within OC Portal Admin Zone to modify blocks this way like you have in your example? 

What I've done  is (like the original poster) taken this line of code:

Code

 $info['cache_on']='array(array_key_exists(\'param\',$map)?$map[\'param\']:\'General Chat\',array_key_exists(\'limit\',$map)?$map[\'limit\']:6)';
  and replaced 'General Chat' with a list of the forums I want to include, separated by commas.  Unfortunately, I must be doing something wrong because it's not working.  :(

Thank you for your help!

Kelli
 
Back to the top
 
Posted
Rating:
#35299
Avatar

When you click a link and the web browser tries to get you to download the .php file, this is typically a problem with the server being too slow to load the page. Instead of finishing loading the page, the server fails and basically the web browser gets confused and thinks it's doing a download.

The link that you're clicking would normally lead you to an editing screen, under which it would be fairly straight-forward to directly type in and submit some text changes to the Comcode.

I'm sorry your experiencing these troubles :(. Unfortunately there's not much I can suggest. As I understand it, this server has been failing on all of ocPortal, bigdump, and phpMyAdmin, and that means there is a server problem rather than a software problem. In my experience, most webhost technical support staff basically use a FAQ database and don't have direct technical expertise – which makes it difficult to get proper progress solving these kind of problems unless the matter gets escalated somehow.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#35300
Avatar

Fan in action

 

Chris Graham said

When you click a link and the web browser tries to get you to download the .php file, this is typically a problem with the server being too slow to load the page. Instead of finishing loading the page, the server fails and basically the web browser gets confused and thinks it's doing a download.
Hi Chris!  I take it this is in response to my other thread about the speed issues/download php prompts.  Thanks for explaining this, it makes sense.  I will pursue it with my server company.

 

Chris Graham said

The link that you're clicking would normally lead you to an editing screen, under which it would be fairly straight-forward to directly type in and submit some text changes to the Comcode.
I'm sorry, which link are you talking about, Chris? 

 

Chris Graham said

I'm sorry your experiencing these troubles :(. Unfortunately there's not much I can suggest. As I understand it, this server has been failing on all of ocPortal, bigdump, and phpMyAdmin, and that means there is a server problem rather than a software problem. In my experience, most webhost technical support staff basically use a FAQ database and don't have direct technical expertise - which makes it difficult to get proper progress solving these kind of problems unless the matter gets escalated somehow.
  No worries, I am pleased with OCPortal… just need to work out some kinks, many of which appear to be server-related anyway.   I do have a couple of issues that I believe are OC Portal related though (they are coming up as "OC Portal Error" messages).  I submitted a ticket on it this afternoon but now it's not appearing on my tickets page.  Should I submit it?

Thanks again for your time!

Kelli
Back to the top
 
Posted
Rating:
#35310
Avatar

I'm sorry, which link are you talking about, Chris?  

The little 'Edit page' links shown underneath pages when logged in.

I submitted a ticket on it this afternoon but now it's not appearing on my tickets page.  Should I submit it?

If I remember correctly we did get a ticket come through corrupt. I think it was one of those cases where an image was attached but it didn't finish uploading. Please re-submit.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#35324
Avatar

Fan in action

Thank you Chris and Moimaim– it worked!  :thumbs:
Back to the top
 
Posted
Rating:
#38098
Avatar

Community saint

 amichan,

Thank you so much for this example, it is exactly what I was looking for. That is one thing that I would suggest for the Block information in the back is to give and example of 2 of the proper usage of each block. Just thought I would add mine to show another aspect or 2, you can also use the forum ID numbers and change the default number of recent topics to display. Here is my block for active topics

Code

 [block="2, 3, 4, 9, 12, 14, 15, 22, 23, 19, 24, 21, 18, 20, Message Forums (Last 25 Posts)" limit="25"]main_forum_topics[/block]

amichan said

Part of the was a repeat of what I said so I feel good about that.
I did not change the php file to get it to pull data or posts from more then one forum.
I just put all the forums in the peramitors and set the last one for what I wanted in the block title.
The block now has a long name as it pulls from every forum on my forum, but hey it works.

EDIT: This is my block for active topics.

Code

[block="OC Power News, OC Power feed back, General Discussion, ocPortal support, Invision Power Board support, SMF support, OC Power skins support, ocPortal comment topics, Forums"]main_forum_topics[/block]


Last edit: by rick

Rick Henson

OCP 4.3.2 & 5.0.1
PHP 5.2.5
MySQL 5.0.51a
FireFox 3.6.8
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: