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.


Using a banner in a signature

Login / Search

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

Community saint

Hi,

I currently have it configured so that I can change the link and image of the users profile signature in one place and this gets picked up by the a one liner that all the moderators include in their signature.

I would like to change this to use banners. We already use banners on the main pages header.

I created a new banner type called signature and a banner called ModSig.

Upon creation the banner page shows you how you might use it:

<!– banner sharing –>
<iframe frameborder="0" marginwidth="0" marginheight="0" style="width: 620px; height: 93px" scrolling="no" src="Banner">
</iframe>
<!– End of banner sharing –>

If I create an html page with the above I just get a blank page.

I was hoping that I could just put an img reference in the signature itself of Banner
and that would display one of the banners that are available at the time of the forum page load of the signature.

Any one else tried this or come across this ?

Cheers
Ade
Back to the top
 
Posted
Rating:
#106011
Avatar

Hi,

I took a look and it's a very specific cause.

You are showing it with a source of ModSig, and your only banner in there is ModSig. It therefore will not show, because a site in the rotation will never show the viewing site's (defined by 'source' parameter) own banner.

Just remove the 'source' parameter.


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

Adding this to docs to clarify how it works…

Banners are shared on a site network using an iframe going to a URL like:
http://centralsite/banner.php?source=sitename&b_type=bannertype
This code is given out when you add a banner. The 'source' comes from the name of the banner you added, which for purposes of a banner network, is considered also as the name of the site also showing banners in the network. A source site won't be shown its own banners. If you wish you may just strip out the source parameter if you don't need such a restriction – if, for example, you are just using the banner sharing code all within your own site.


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

Community saint

Hi Chris,

That makes complete sense now you point it out.

I would like to use the banner in signatures:

Code

[page=":modsig2"][img param=""]http://vwgolfmk1.org.uk/themes/V9MK1OC/images_custom/modsig.jpg[/img] [/page]
[page=":modsig2"][img param=""]http://vwgolfmk1.org.uk/banner.php?b_type=signature[/img][/page]
The top one is the current signature code and works.

The second line is the one trying to use the banner and that does not.

If I go directly to the URL then the image displays, is it not possible for banner.php to function in the signature area ?

Cheers
Ade
Back to the top
 
Posted
Rating:
#106016
Avatar

Community saint

Hi Chris,

I also tried using the block construction assistant to add a banner block to the signature, but it got half way through and froze. In fact all the buttons do not seem to work properly, some let you get half way through and others just seem to save the profile and return back to no edit mode.

Perhaps a side effect of the language work you did for us?

Cheers
Ade

Back to the top
 
Posted
Rating:
#106017
Avatar

Community saint

I have also just tried the same on the main OCP site and it appears to behave the same.

Edit profile, select signature, Click the Add image button.

You can enter the URL ok, but it gets stuck at the caption entry.

Cheers
Ade
Back to the top
 
Posted
Rating:
#106018
Avatar

It needs to be added as an HTML iframe, not an image.

If they have dangerous Comcode privilege, they can use Tempcode: {$BANNER,signature}.


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

Community saint

Hi,

Just in case you are wondering I made this work (with a couple of pointers from Chris) using a custom ComCode tag called "signature" and a banner type also called "signature":

I set the "Replacement Text" to

Code

<iframe frameborder="0" marginwidth="0" marginheight="0" style="width: 620px; height: 93px" scrolling="no" src="http://vwgolfmk1.org.uk/banner.php?b_type=signature">{content}
</iframe>

Then in the signature in each profile I added:

Code

[signature][/signature]

It works well with only one minor irritation:
I have four validated signature banners. If I have 5 posts in a topic I was hoping that I would get a more random selection, however the first post gets a banner and then the other four always get the same one.

Cheers
Ade

Back to the top
 
Posted
Rating:
#106055
Avatar

Interesting problem. I guess the browser is doing some basic caching of the frame contents. Try adding &rand={$RAND} after b_type=signature.


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

Community saint

It is :-)

Adding &rand={$RAND} does not change the behaviour at all
Back to the top
 
Posted
Rating:
#106065
Avatar

You'd need to re-edit the sigs too, as it would have cached.

For the record it would also be better to use the $BANNER symbol in the Custom Comcode tag, as that avoids an iframe (all one web request).


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

Community saint

Ok I have changed it to the $BANNER symbol and it works as expected.
There is still the cache issue, do I really have to go in to the 20 odd signatures and make a change to get them to re cache ? (Just edit and save is not enough as you must look for zero change and do nothing !!)
I tried the website cleanup tools to clear all the caches, but they do not change the signature caches.

Cheers
Ade
Back to the top
 
Posted
Rating:
#106070
Avatar

Good insight. Yes it seems we do. This is the "Comcode field precalculations" cache, which isn't decachable on large sites (i.e. the option disappears), because it's such a massive flush of data out of the database (it's not scoped to any particular content type).

Code

   if (get_translated_text($_signature)==$new_signature) return;


So you'd need to go make some trivial change in each I'm afraid.

Or, on your particular site you can do a query like UPDATE ocp_f_members SET m_signature__text_parsed='';
(due to the big changes we did for you)


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: