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.


Modification of calender block help

Login / Search

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

Fan in action

how mod

Hi
I'm not a programmer php need do same modif at ocportal to use on intyernal network like home page of office site need 2 thing.
1) mode the module of clock  to place top or bottom the calendare ti time too like clock
2) create a page with links categorized
samone can help

Back to the top
 
Posted
Rating:
#108518
Avatar

Community saint

Hi,
1) You can add ($TIME} and {$DATE} to the BLOCK_SIDE_CALENDAR_LISTING.tpl to output the users local date and time, which is the easiest way to present this information.
2) v10 has A-Z indexes. I know this doesn't answer the question but it's good to know.
Back to the top
 
Posted
Rating:
#108519
Avatar

Fan in action

When released the v10 :D

PS
I see the tpl file tell me but not the block that I have on main page ..


Last edit: by nickgallis
Back to the top
 
Posted
Rating:
#108520
Avatar

Community saint

Nobody knows when v10 will be ready, the alpha code has been available to view/test for a while. Early 2015 is what the Compo.sr site predicted. I would think that it will be ready sometime this year, or next :D

You probably want to edit BLOCK_SIDE_CALENDAR.tpl then.
Back to the top
 
Posted
Rating:
#108521
Avatar

Fan in action

ok I mod correct tpl add the cot to a live clock :D now one other simple problem to add ip address from client surf  site in this block think can use the variable $REMOTE_ADDR but dnt understat how make print to value of this variable

PS
Can you give me link to v10 alpha if possible to try?
Back to the top
 
Posted
Rating:
#108522
Avatar

Community saint

It would be

Code

<?php echo $_SERVER["REMOTE_ADDR"]; ?>
but if you add that directly to the template you will need to enable the hidden allow_php_in_templates value via OcCLE

Code

:set_value('allow_php_in_templates','1');

I was thinking that the existing Tempcode {IP_ADDRESS} or {GEOLOCATE} should work, but maybe I am missing something.

v10 alpha is @ https://github.com/ocproducts/composr (not currently suitable for anything but testing and evaluation).
Back to the top
 
Posted
Rating:
#108524
Avatar

Fan in action

ok now try to see if there's same tempcode to use dnt like mode template to use php
Back to the top
 
Posted
Item has a rating of 5 (Liked by KingBastLiked by Chris Graham)  
Rating:
#108533
Avatar

Community saint

Another option for adding an IP address to templates without enabling PHP in templates is to create a new tempcode symbol. Just copy the attached file to sources_custom/hooks/systems/symbols directory and then you can use {$REMOTE_IP_ADDRESS} as the tempcode symbol to represent the remote client IP address. This does exactly what KingBast posted above; it just keeps the PHP out of the templates.
Attachment
REMOTE_IP_ADDRESS tempcode symbol
» Download: REMOTE_IP_ADDRESS.php (112 Bytes, 63 downloads so far)
Back to the top
 
Posted
Rating:
#108541
Avatar

Fan in action

ok tks im out of work when i came back try tks very much
Back to the top
 
Posted
Rating:
#108554
Avatar

Fan in action

hi I try but this path sources_custom/hooks/systems/symbols dnt exist .
after add the file in the path need do other? beacuse not work adding {REMOTE_IP_ADDRESS} in the tpl file

PS
TKS work lost to place $ :D


Last edit: by nickgallis
Back to the top
 
Posted
Rating:
#108562
Avatar

Community saint

You need to create the symbols folder, ahh you got it working, good :)


Last edit: by KingBast
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: