Help with tables?

Permalink Browser Info Environment
I am having a hard time finding examples of the code used in a table.

Bellow is the code for how I would like my table to look.
I have used a $value to state where I would like each set value to go.
I have specific values for this table setup. And would like the $callsign value to also link to the profile.

[code]

<?php defined('C5_EXECUTE') or die(_('Access Denied.')); ?>
<table id="pmw-eul-UserListTemplate_<?php echo $bID; ?>" border="0" width="42%" cellspacing="1">
<tr>
<td><b><font face="Verdana">Callsign</font></b></td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellspacing="1" cellpadding="0">
<tr>
<td width="101">
<p align="center">avatar</td>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="81"><font face="Verdana" size="2">Real Name</font></td>
<td>$name</td>
</tr>
<tr>
<td width="81"><font face="Verdana" size="2">Class</font></td>
<td>$class</td>
</tr>
<tr>
<td width="81"><font face="Verdana" size="2">Primary</font></td>
<td>$pri</td>
</tr>
<tr>
<td width="81"><font face="Verdana" size="2">Secondary</font></td>
<td>$sec</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script type="text/javascript">
//<![CDATA[
$(function(){
PMW.fetchEUL('<?php echo $controller->getAjaxUri(); ?>?bID=<?php echo $bID; ?>&pg=1');
});
//]]>
</script>
[code]

Any help would be great. I am really new to this :(

Thank You

Type: Discussion
Status: New
stonereptiles
View Replies:
stonereptiles replied on at Permalink Reply
stonereptiles
<?php  defined('C5_EXECUTE') or die(_('Access Denied.')); ?>
<table id="pmw-eul-UserListTemplate_<?php  echo $bID; ?>" border="0" width="42%" cellspacing="1">
   <tr>
      <td><b><font face="Verdana">Callsign</font></b></td>
   </tr>
   <tr>
      <td>
      <table border="0" width="100%" cellspacing="1" cellpadding="0">
         <tr>
            <td width="101">
            <p align="center">avatar</td>
            <td>
            <table border="0" width="100%" cellspacing="0" cellpadding="0">
               <tr>
                  <td width="81"><font face="Verdana" size="2">Real Name</font></td>
Shotster replied on at Permalink Reply
Shotster
I'd be glad to help. EUL templates are a bit different from "regular" C5 templates in that you generally won't need to use any PHP (which actually makes them a little easier to work with).

So first, instead of giving me the HTML/PHP code, can you provide me with an example (screen shot) or description of what you want the table to look like along with the information you want it to include? Then I'll be better able to help you with the template.

You can also look at the sample templates. Pick one of the table templates and copy it to a mirror directory at the root of your site. For example, copy...

/packages/pmw_enhanced_user_list/blocks/pmw_enhanced_user_list/templates/table_with_borders.php

...to the following directory...

/blocks/pmw_enhanced_user_list/templates/my_custom_table_template.php

Then (if you need to) modify the my_custom_table_template.php file - NOT the one in the packages directory. That way, your changes won't be overwritten when you upgrade the add-on. This is a C5 thing - not a EUL thing.

So again, please provide me with a description or screenshot of what you want the table to look like. Then I can be of more assistance.

I think you're making it harder than it actually is. You should be able to add the block to a page, configure it, and then choose your custom template. That's it.

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
Making the custom template is where I am stuck.

Heres the image of what I am going for

http://www.warden-securities.com/Untitled.png...

Is there a way to fill in address/phone/email as well but only have certain user groups be able to see it?

Thank you
Shotster replied on at Permalink Reply
Shotster
Do you want "Callsign" to appear above the avatar of each user in the list or just once above the entire list?

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
Sorry the word callsign should be $callsign. It's a user set variable.
Shotster replied on at Permalink Reply
Shotster
So for each user in the list, you want the avatar to appear on the left and the other user details to the right of the avatar. Is that correct?

Also, can you provide me with the handles of the user attributes you created. In other words, when you created the "Real Name" user attribute, you had to specify a handle for it - probably something like "real_name" if you followed the C5 convention. Can you give the handles for each of the attributes you want to display in the user list? You can find them in the dashboard when you view the detail of an attribute. I have no idea what "class," "primary," and "secondary" mean, but I'm assuming those are user attributes you created, right?

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
Those are attributes I created yes.
callsign is 'callsign'
primary is 'w1'
secondary is 'w2' (Both of these can be rather long options)
real name is 'name'
class is 'class'

Could you create a third block beside as an option for address/phone/email? Or I guess I would need tow seperate templates yes?
Shotster replied on at Permalink Reply
Shotster


> Could you create a third block beside as an option for address/phone/email?
> Or I guess I would need tow seperate templates yes?

You wouldn't necessarily need a different template if the address, phone, and email are to appear beneath the rest of the attributes to the right of the avatar. I'll provide you with an example shortly.

-Steve
Shotster replied on at Permalink Reply
Shotster
> Is there a way to fill in address/phone/email as well but only
> have certain user groups be able to see it?

The way to do that would be to add two different EUL blocks to the page - one with the address, phone, and email and one without. Then just set the block permissions (using C5's block permissions capabilities) so that only certain groups can see each of the lists.

You will need to enable advanced permissions if you have not done so. That's a C5 thing - not an EUL thing.

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
Okay so it's a matter of creating a seperate block with different activated attributes and a seperate template?

Thanks
Shotster replied on at Permalink Reply
Shotster
Different attributes selected, yes; but not necessarily a different template (unless you want the layout/appearance to be dramatically different).

-Steve
Shotster replied on at Permalink Reply
Shotster
So tell me if something along the lines of this layout is what you're after...

http://temp.perceptualmediaworks.com/2011-12-10_1728.png...

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
Yes! But primary doesn't need to be multiple lines. Just one long line. Secondary is perfect.

Sent from my iPhone
Shotster replied on at Permalink Reply
Shotster


Ok. Well, if you're not in a hurry, I can put together a template and some styles and have it to you by the end of the weekend. That way you'll have a start and something you can tweak.

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
Your my hero. Look forward to it. Thank you!!

Sent from my iPhone
stonereptiles replied on at Permalink Reply
stonereptiles
The website is
www.www.warden-securities.com/home/...
We are a milsim airsoft team. Based around the Private Military Contractor/blackwater style.
If that helps at all?

Thanks again!
Shotster replied on at Permalink Reply 1 Attachment
Shotster
> I can put together a template and some styles...

Ok, attached is a zip archive containing a template file and a CSS stylesheet. The styles in the stylesheet should just be copied and pasted into your main.css stylesheet.

Following is a screenshot (you can of course tweak the colors etc.)...

http://temp.perceptualmediaworks.com/stonereptiles-user-list-exampl...

Some things to note:

* I can't guarantee the styling will render properly in IE6. I no longer support that browsersauraus. Styles do render properly in IE7+ and the other major browsers (Safari, Firefox, Chrome).

* You might be surprised at how lightweight the template mark-up is. Trying to do layouts using tables is not a good idea and creates code that is bloated and difficult to maintain (unless you wanted a basic row x column listing, in which case a table would be just fine). All the magic is in the CSS styling. Also, the "font" tags you were using are obsolete. It might be a good idea to bone up on CSS.

* To change the order of attributes - for example, if you wanted "Class" to come before "Real Name," just change the order in the block configuration dialog.

* To allow certain logged-in users to see the phone numbers, addresses, and emails, just add a second block using the same template. Configure it just like the first block, and then select the additional attributes by checking their checkbox. Drag them in the desired order and save the block. Now just use the built-in C5 permissions mechanism to set the permissions on that block so that only certain group(s) can see it. (You'll have to enable advanced permissions if you haven't already.)

That should do it.

Regards,

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
Thank you.
I used it here
http://www.warden-securities.com/home/index.php?cID=139...
It's looking wierd. I'm playing with the colors. but It's showing the call sign in the wrong location. I am unsure why?
My template does not seem to have a main.css so I had to add the css to minimalist_base.css

I never changed nothing. but must of done something wrong?

Thank you again. you have helped a lot. I really need to learn CSS :(
stonereptiles replied on at Permalink Reply
stonereptiles
Never mind. Figured out why!

How can I make the callsign link to the profile page? :)


Thank you again!
Shotster replied on at Permalink Reply
Shotster
> How can I make the callsign link to the profile page? :)

Well, the officially supported method for linking to profiles is just what the documentation states - i.e. any anchor "a" tag having a class of pmw-eul-UserProfileLink will link to the user's profile. So, within the UserRepeat element, you can add an anchor tag with the text "Click for Profile" or something. Unfortunately, that won't allow you to use one of the attribute values as the link (in your case, the callsign attribute).

HOWEVER, there is a more advanced technique that I will share with you. It is functionality that is not documented and thus not supported at this time. To accomplish what you want, proceed with the following 2 steps:


1) Change the UserRepeat part of your template file to look like this...

<ul class="pmw-eul-UserRepeat">
   <li class="callsign">
      <span class="pmw-eul-UserAttributeName"></span><a class="pmw-eul-UserAttributeValue pmw-eul-UserProfileLink"></a>
   </li>
   <li class="pmw-eul-UserAttributeRepeat">
      <span class="pmw-eul-UserAttributeName"></span><span class="pmw-eul-UserAttributeValue"></span>
   </li>
</ul>


2) Change the section in your CSS styles that reads...

div.stonereptiles.userlist li.callsign span.pmw-eul-UserAttributeValue {
   font-size: large;
   font-weight: bold;
}


...and make it read as follows...

div.stonereptiles.userlist li.callsign a.pmw-eul-UserAttributeValue {
   font-size: large;
   font-weight: bold;
}


In other words, just change the "span" to an "a".

That should do it,

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
It worked. Sadly it than took the format of a link
Since I made the background black I can no longer see the link. It is no longer bold either

I tried this
div.stonereptiles.userlist li.callsign a.pmw-eul-UserAttributeValue {
   font-color: #FFFFFF;
   font-size: large;
   font-weight: bold;
}

But the link CSS is overwriting it.
How can I make it overwrite?
Shotster replied on at Permalink Reply
Shotster
> Sadly it than took the format of a link

Yes, that's what links do. ;-)

You might have to tweak the styles. That's basic CSS and nothing specific to the EUL add-on.

I checked your site, and it seems you've got it figured out. The links are visible for me. If they aren't for you, let me know which browser you're using.

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
I changed the whole site to have white links. Lol

Looks okay for now. I'll play with how to force CSS later

Thank you again. Your add-on is awesome.
Wont work on a iphone though it seems.
Shotster replied on at Permalink Reply
Shotster
> Wont work on a iphone though it seems.

Don't know why it shouldn't. If I recall, it works on my iPod and iPad, but I'll double check.

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
Very true. Not sure what my phone was doing. works great. looks even better on the iphone heh.

Wish I could have those output as an image for forum signatures.

Looks awesome. thank you
Shotster replied on at Permalink Reply
Shotster
> Wish I could have those output as an image for forum signatures.

With the latest iOS on iPad, if you press and hold the home button and then press the power button, it will take a screenshot and save it to your camera roll. Don't know if the iPhone works the same way, but if so, you should then be able to transfer it to your desktop machine and incorporate it into your website.

Good luck,

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
Works now. never tried that screen cap feature. will need to try it.

You sir need to build a custom profile add-on! the C5 profile is a nightmare. it needs more features!
Shotster replied on at Permalink Reply
Shotster
> Don't know why it shouldn't. If I recall, it works on my
> iPod and iPad, but I'll double check.

I double checked, and it worked straight away on my old iPod running iOS 3.x. On my iPad 2, however, there was an issue UNTIL I cleared the browser cache. Now it works just fine.

It's apparently an issue with the cache and AJAX on the latest iOS. At least there's a simple fix. :-)

-Steve
Shotster replied on at Permalink Reply
Shotster
It appears your link styles are defined in typography.css. You might have to tweak them there.

-Steve
stonereptiles replied on at Permalink Reply
stonereptiles
I'm not sure what I need to tweak. will do some reading/learning.
I took most of my web design training 8 years ago. and there was almost nothing on CSS

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.