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.


Online status by use name in posts...

Login / Search

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

Community saint

I wanted a feature like above, like other forums have.   Yeah, I know you can hover over their name and see that, but I wanted a more instant status.

So I did add it in.   Here's what it looks like with the quick graphics I threw in:



I'm off to bed, but I jotted down notes of what I did, so if you are interested, I will post up the mods I did to make this happen.

Which I will do when I can either way.  As I'm sure I can get a big lesson on ocportal with 'corrections' on what I did (for the sake of portablity and conformity to the code).   ;)

Paul

Paul
Back to the top
 
Posted
Rating:
#78039
Avatar

Community saint

Ok, I these are the filed I edited, and moved to the proper _custom directories.

OCF_TOPIC_POST.tlp

Code (php)

    <!--<td class="{CLASS*}">-->
    <td style="isplay: table-cell; vertical-align: middle">

        <!--{EMPHASIS*} {+START,IF_EMPTY,{EMPHASIS}}
            <div class="ocf_post_empty"> -->

                <!-- user online/offline graphic -->

                  &nbsp;{USER_ONLINE}

                <!-- end -->

                <!--<a href="#"><img title="{!BACK_TO_TOP}" alt="{!BACK_TO_TOP}" src="{$IMG*,top}" /></a>
            </div>
        {+END}-->
    </td>
 

I commented out the stuff that put in the up arrow/back to the top image/link.  And put in the code where the link to the online/offline image is displayed.  Changed the table so the image is vertically centered. I should have found or added this CSS into one of the CSS files, but I am not real experenced with CSS so I didn't even look for that. And I have no idea what EMPHASIS is or does.

OCF_TOPIC_POST_ONLINE.tpl

Code (php)

<img  title="" alt="Online Status" src="{OSTATUS*}" />
 

This template did not exist before.   Yes, the 'online status' text should be a template variable that is in one of the lang files, like the CSS, I did not look to figure out where such a thing should go.

forum/pages/modules/topicview.php

Code (php)

            // user online/offline
            if (member_is_online($_postdetails['poster'])) {
              $poster_online=do_template('OCF_TOPIC_POST_ONLINE',array('_GUID'=>'d647ada9c11d56eedc0ff7894d33e83c','OSTATUS'=>"http://www.air-rc.com/themes/default/images_custom/ison.png"));
            } else {
              $poster_online=do_template('OCF_TOPIC_POST_ONLINE',array('_GUID'=>'d647ada9c11d56eedc0ff7894d33e83c','OSTATUS'=>"http://www.air-rc.com/themes/default/images_custom/isoff.png"));
            }

 

Added the above around like 243, just above the //Avatar code.    I don't know what _GUID is or is used for, I just put in the same number from a different do_template call, this is probably the wrong thing to do.   Also manually typed in the link to the image files, which is definately wrong, but did not figure out which function to use to build the url to the custom image file, or where to put the name of those files.  Thus I hard coded it.

So still much to learn, but am getting there.  Any pointers on how to 'fix' this to be in 'compliance' with ocportal coding would be appriciated.

Paul
Back to the top
 
Posted
Rating:
#78089
Avatar

So still much to learn, but am getting there.  Any pointers on how to 'fix' this to be in 'compliance' with ocportal coding would be appriciated.

Your code always seems fine :).


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:
#78092
Avatar

Community saint

Hardcoding the image files is fine and within the ocportal standard?

Paul
Back to the top
 
Posted
Rating:
#78094
Avatar

ah no, find_theme_image('ison')


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
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: