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.


making a side block for image links

Login / Search

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

Honoured member

How would i go off into this? Almost all of my attempts failed miserably..

I just cant get the images to show through PHP.. HTML is all good, but as soon as i need to get in the block page im stuck..

I hope someone could provide me with the code that is needed to show the block with the images in it, and when you click on a image it takes you to that site..

I really dont know how much coding this would need, so i dont know if this still falls under user to user help.. ?
 

:D  Dont shoot the messenger!!  :D

How many of you believe in telekinesis? Raise my hand.

Chris Graham said

I guess a warning in your line of work tends tomean 'run for cover'. Fortunately it's not so severe when it comes to computers ;).
Back to the top
 
Posted
Rating:
#28899
Avatar

Could you describe your situation a bit more please. Are you:
  • creating a new block
  • creating a new ocPortal menu
  • just wanting to display some images that are links
?

If you just want to add some images, it should be pretty straight-forward with Comcode…

Code

[url="http://www.example.com/a.html"][img]uploads/website_specific/1.png[/img][/url]
[url="http://www.example.com/b.html"][img]uploads/website_specific/2.png[/img][/url]
[url="http://www.example.com/c.html"][img]uploads/website_specific/3.png[/img][/url]

(assuming you have placed the images in uploads/website_specific.


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

Honoured member

Im trying to create block, to keep the left and right side of the site even.

In this block i want to show images, and when you click on them they redirect you to a website

Something like the OCP image on the lower left side of a unregistered site, but instead of a DIV class i want to use a block for that. ( already looked at that because it has the small image with link in it.)



I tryed editing a existing block,

Code

<?php
/*
 ocPortal
 Copyright (c) ocProducts, 2004-2006

 You may not distribute a modified version of this file, unless it is solely as an ocPortal modification.
 See text/en/licence.txt for full licencing information.
*/

class Block_side_links
{

   /**
    * Standard modular info function.
    *
    * @return ?array    Map of module info (NULL: module is disabled).
    */
   function info()
   {
      //removed-assert

      $info=array();
      $info['author']='Leon K.';
      $info['organisation']='TeamGFR';
      $info['hacked_by']=NULL;
      $info['hack_version']=NULL;
      $info['version']=1;
      $info['locked']=true;
      $info['parameters']=array('param','efficient','id','filter','filter_b','title');
      return $info;
   }
*********************************************************
$my_site1 = <a href="http://www.novahq.net"> <img src="nhq.gif" /></a>;
$my_site2 = <a href="http://www.novahq.net"> <img src="nhq.gif" /></a>;
$my_site3 = <a href="http://www.novahq.net"> <img src="nhq.gif" /></a>;
echo $my_site1;
echo $my_site2;
echo $my_site3;
***************************
<html>
<a href="http://www.novahq.net"> <img src="nhq.gif" border="0" /></a><br />
</html>
***********************************************************

?>
</body>
</html>


what is between the *** is what i have been trying so far.. Ive been looking for include functions also, but that did not produce any result also..

When i place the php file (side_links.php) in the custom blocks directory, it gives me a error..  forgot to note it down, but will do that after i come back form the shower, something with this in it: Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'
I copy'd that from somewere because it is almost the same as i have..
 

:D  Dont shoot the messenger!!  :D

How many of you believe in telekinesis? Raise my hand.

Chris Graham said

I guess a warning in your line of work tends tomean 'run for cover'. Fortunately it's not so severe when it comes to computers ;).
Back to the top
 
Posted
Rating:
#28901
Avatar

Community saint

Hi Leon,

I have something similar to what it is you are after (I think) on my site. I added an extra 'box' to the right panel with this bit of code, where the images are links, etc. etc. The relevant code is sandwiched between a couple of 'blocks', so you can see how it fitted in.

Code

[block]main_quotes[/block]
[semihtml]
<div class="standardbox_wrap_panel" style="BORDER-TOP-WIDTH: 0px; width: 13.3em"><div class="standardbox_classic standardbox_t_panel" style="WIDTH: 13.3em; HEIGHT: auto"><h4 class="standardbox_title_panel">Miscellaneous</h4>
<div style="text-align: center"><br />
   <a title="This page has been checked and found to be valid XHTML 1.0 Transitional. {!LINK_NEW_WINDOW}" href="http://validator.w3.org/check?uri=referer" target="_blank"><img alt="This page has been checked and found to be valid XHTML 1.0 Transitional. - (this link will open in a new window)" src="http://www.maltap.com/anglo/images/xhtml.png" /></a>
</div>
[/semihtml]
[semihtml]
<div style="text-align: center">
   <a title="{!LINK_NEW_WINDOW}" href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img alt="Expect spurious errors. - (this link will open in a new window)" src="http://www.maltap.com/anglo/images/css.png" /></a>
</div>
[/semihtml]
[semihtml]
<div style="text-align: center">
   <a title="Monitored by: InternetSeer {!LINK_NEW_WINDOW}" href="http://www.internetseer.com" target="_blank"><img alt="Monitored by: InternetSeer - (this link will open in a new window)" src="http://www.maltap.com/anglo/images/internetseer_button.gif" /></a>
</div>
[/semihtml]
[semihtml]
<div style="text-align: center">
   <a title="Build your own website. You deserve the best; ocPortal deserves your consideration! {!LINK_NEW_WINDOW}" href="http://ocportal.com/" target="_blank"><img alt="Build your own website. You deserve the best; ocPortal deserves your consideration! - (this link will open in a new window)" src="http://www.maltap.com/anglo/images/ocp.png" /></a>
</div>
[/semihtml]
[semihtml]
<div style="text-align: center">
<!-- Site Meter -->
<script type="text/javascript" src="http://s28.sitemeter.com/js/counter.js?site=s28anglo">
</script>
<noscript>
<a title="{!LINK_NEW_WINDOW}" href="http://s28.sitemeter.com/stats.asp?site=s28anglo" target="_blank">
<img src="http://s28.sitemeter.com/meter.asp?site=s28anglo" alt="Site Stats for Anglo-Indian Portal. Powered by Site Meter - (this link will open in a new window)" border="0"/></a>
</noscript>
<!-- Copyright (c)2006 Site Meter -->
</div><br /></div></div>[block]side_printer_friendly[/block]
[/semihtml]

{$SET,interlock,_false}

The extra formatting is still there and can be reduced. I did this in the early days where I used a 'belts-and-braces' approach because I wasn't sure what I was doing (still don't), but if it works for you, you can clean up the code a bit.

Hope it is of help!

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#28932
Avatar

This is getting more complex than it needs to be. It should be as simple as…

Code

[box="This is box title" type="panel" dimensions="13.3em"]
[url="http://example.com/"][img]http://ocportal.com/uploads/website_specific/ocportal.com/logos/b.png[/img][/url]
[/box]

This is box title


 

There's a confusion about "blocks" and "boxes". A block has no visual representation as a concept, but most blocks are shown in boxes. To create a visual look that is "like that of the block" you don't need to think about blocks, only boxes… and both Tempcode and Comcode can create those very easily.


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

Honoured member

Aahh.. dang, so that is what confused me… Thank you both. Now im going to add ti to my site.. And offcourse show the OCP logo in it. For all the help i have gotten here..

Pfff i really should start paying more attention to all the functionality's…

:D  Dont shoot the messenger!!  :D

How many of you believe in telekinesis? Raise my hand.

Chris Graham said

I guess a warning in your line of work tends tomean 'run for cover'. Fortunately it's not so severe when it comes to computers ;).
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: