Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
themes-topic
Is it possible to do a span?
Avatar
Bill Murray
Member
Free Members
sp_UserOfflineSmall Offline
Dec 28, 2011 - 9:29 am

Is it possible to something like a span by modifying the parameters of something like sp_PostIndexUserStatus?

I would like to display the status after a user's name on the same line.

Update: that was actually a stupid question to ask.  So let me change it to a better one:

Can sp_PostIndexUserDate be used to add a label using _SP, like:

sp_PostIndexUserDate('tagClass=spPostUserDate&stackdate=0 spLeft', __sp('Last Visit: %DATE%'));

That doesn't seem to work and I haven't yet gone on a search for the function.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 28, 2011 - 10:42 am

still not sure I follow you...

where are you wanting to do this? everywhere there is a user name displayed? or specific location?

you can 'concatenate' two template tags if you like by doing them one after the other... if you change both container divs to have style of display:inline they will appear next to each other...

Avatar
Bill Murray
Member
Free Members
sp_UserOfflineSmall Offline
Dec 28, 2011 - 3:08 pm

I am going for the "stacked" look for a wider content area.  It fits my long-winded tendencies better laugh

http://www.wpperform.com/forum.....gins-work/

In the spInfoSection, I want to add Last Visit: before the date of the last visit.  But doing that to sp_PostIndexUserDate using an approach similar to other functions doesn't work, as you can see on the link.  The date displays, but no label.

Does that clarify?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 28, 2011 - 4:02 pm

The sp_PostIndexUserDate() template tag has no label parameter so your first notion will never work.

But in the actual templat where you make the call you can place any php or html anywhere you want it. So at the most basic you could do something like:

echo 'Last Post ' . sp_PostIndexUserDate('get=1');

as an example.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Dec 28, 2011 - 7:44 pm

I would start by going back to the SP supplied stacked theme and looking in spTopicView.php and see how it is done there.

IE:

 

sp_ColumnStart('tagClass=spInfoSection spLeft&width=30%&height=60px');
 sp_SectionStart('tagClass=spLeft', 'user-dates');
 echo '<span class="spPostUserDate">'.__sp('Last Visit').': </span>';
 sp_PostIndexUserDate('tagClass=spCenter spPostUserDate&stackdate=0');
 sp_PostIndexUserRegistered('tagClass=spPostUserRegistered spCenter', __sp('Member Since: %DATE%'));
sp_PostIndexUserPosts('tagClass=spPostUserPosts spCenter', __sp('Forum Posts: %COUNT%'));

sp_SectionEnd('', 'user-dates');

sp_ColumnEnd();

 

You can then move the info around, up down or change the width of that column as needed to match your layout.

The code shown should show you something like this which sounds like what you are wanting.

Last Visit: December 19, 2011 - 9:03 pm

Member Since: September 12, 2011

Forum Posts: 10

From there you could add this just about anywhere in spTopicView.php

echo '<span class="spPostUserDate">'.__sp('Last Visit').': </span>';

 sp_PostIndexUserDate('tagClass=spCenter spPostUserDate&stackdate=0');

Avatar
Bill Murray
Member
Free Members
sp_UserOfflineSmall Offline
Dec 28, 2011 - 11:27 pm

@Yellow Swordfish, Without making a lot of changes to the CSS, that didn't quite work. 

@Brandon, Thanks for the suggestion.  I had already looked at other samples.  My question was not so much about how to display the date as to how to position it.

It turns out my problem was the extra markup added by sp_SectionStart and spSectionEnd.  If I kept all of the code with a sp_ColumnStart and sp_ColumnEnd, I am fine.  You can see the work in progress here:

http://www.wpperform.com/forum.....d-pricing/

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 29, 2011 - 5:27 am

Looking good...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Bill Murray
Member
Free Members
sp_UserOfflineSmall Offline
Dec 30, 2011 - 12:00 am

Thanks, Yellow Swordfish.

Btw, I was using the css only theme as a starting point.  You may want to check on that theme's css-only.css:

Line 383 - inherit is mis-spelled as inheit, which causes the intended font family selection to break

Line 1892 - double ; at the end

I've made a lot of changes since your last post.  I'm not 100% done, and I have not tested options or settings which I have disabled.  Any feedback, particularly in the area of readability, is appreciated.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 30, 2011 - 1:49 am

corrections made in css only theme... thanks...

feedback?  too much white space and not enough borders... kisstwistedeekcool

just kidding...  looking good...  will add one thing though... the text labels (and image) in your buttons seem to have dropped a few pixels and are not centered vertically...

Avatar
Bill Murray
Member
Free Members
sp_UserOfflineSmall Offline
Dec 30, 2011 - 8:09 am

I've been taking a quarter out of jar for every 1px of border I remove.  Pretty soon I'll be calling you.  I'll have enough to go on a nice cruise.  laugh

Good eye for picking up on the buttons.  The buttons are 1 area where I haven't spent much time.  The jury is still out on whether I should use CSS gradients on them.  My quick take is that CSS gradients can work over bigger spaces, but in small ones, handcrafted gradients from Photoshop look better.  I also want to make that consistent with my overall theme.  SPF has the most buttons in one place, so I'll figure out my preference on the forum and let that carry the day elsewhere.

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625