Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Hide Empty Fields 
 
Hi again everyone,

I'm trying to figure out how to hide empty profile/viewtopic fields.  If a user doesn't enter their location in their profile, the field "location" still shows.  I'm trying to get the "location" field to disappear from profiles if a user didn't enter their location.  The same thing goes for viewtopic.  A blank space is in place of an empty location field.  How would I go about removing these fields if the user didn't enter anything into them?

Thanks!
 




____________
| Icy Phoenix ColorizeIt! |
Bipolar Disorder - Not good for you and definitely not good for everyone else.
 
ChaoticSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
Just mentioning this again.

This will help to keep forums looking neater and more professional looking.  I know what I need are some SWITCH tags, but I just don't know the necessary code.
 




____________
| Icy Phoenix ColorizeIt! |
Bipolar Disorder - Not good for you and definitely not good for everyone else.
 
ChaoticSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
I stand to be corrected, but it wouldn't be practical.

Apart from a huge re-write of the .php files with if and else arguments that query the Db to see if the entry has been filled in, it would also have to be programmed with new Block-Vars to return different template options.

That would mean new vars for every field that the user has a choice of filling in or not.

Then they would have to be applied to all of the templates that are available to the user <-- Begin Not Filled In Here etc. and <-- Begin Filled In Here etc, so that the correct templates are shown.

Then one would have to start re-writing the .tpl tables to accommodate the switches, and that itself would be a nightmare.

It gets worse - What if the User doesn't fill something in, and the option block disappears - How does one go back and fill it in then ?

It's more than a few switches, it's a huge rewrite.  

Edit: And templates with left, right and multiple fields, it would be impossible to accommodate all options that may or may not be included, and hold the whole thing together.
 
 
 
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
Lopalong wrote: [View Post]
I stand to be corrected, but it wouldn't be practical.

Apart from a huge re-write of the .php files with if and else arguments that query the Db to see if the entry has been filled in, it would also have to be programmed with new Block-Vars to return different template options.

That would mean new vars for every field that the user has a choice of filling in or not.

Then they would have to be applied to all of the templates that are available to the user <-- Begin Not Filled In Here etc. and <-- Begin Filled In Here etc, so that the correct templates are shown.

Then one would have to start re-writing the .tpl tables to accommodate the switches, and that itself would be a nightmare. :p


I understand what you mean, but I think it's more practical than you think.  What is the use of an empty profile field?  It sits there taking up space in the already cluttered profile page.  Any subtraction to the profile page is a plus.

You can't tell me this doesn't look sloppy, unorganized, and completely unprofessional.

Spoiler: [ Show ]


Wouldn't you rather your viewtopic look something like this?  Notice how I filled out all my profile information, therefore, everything under my avatar looks nice and neat because my profile is complete.

Spoiler: [ Show ]


Lopalong wrote: [View Post]
It gets worse - What if the User doesn't fill something in, and the option block disappears - How does one go back and fill it in then ?


I'm not really sure if you understand what I mean.  The empty fields are always there when editing your profile.  If you fill out the "Location" field, it will show your location on viewtopic.  If you don't fill out the "Location" field, the whole field won't be shown on viewtopic, but the empty "Location" field is still viewable and empty when editing your profile.  It becomes invisible and erases any mention of a location field.  You can always go back and edit your profile to include your location if you wish to.  There was a mod like this for phpBB2, I just can't remember the title or who the author was.

To be honest, this should have been taken care of in the first release of IP.  IP is brilliantly packed with most every useful modification you can think of, so why not include something as small as this?  It was easily possible and 'do-able' with a vanilla copy of phpBB2.  The profile page is jam packed with information, so why not make it easier on your older user's eyes and brains and simplify the page a little?

/opinion.
 




____________
| Icy Phoenix ColorizeIt! |
Bipolar Disorder - Not good for you and definitely not good for everyone else.
 
ChaoticSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
Hehe!

I did beat it up with the wrong train of thought on what you were trying to achieve. The pic made all the difference.

Try this:

Open viewtopic_body.tpl

Find:

Spoiler: [ Show ]


Replace with:

Spoiler: [ Show ]


You will probably have to add class="?" to the <p strings to control the text size etc.
 
 
 
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
That worked perfectly!  Another idea would be to remove empty fields from the profile...any suggestions?

Thanks again Lopalong.
 




____________
| Icy Phoenix ColorizeIt! |
Bipolar Disorder - Not good for you and definitely not good for everyone else.
 
ChaoticSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
many thanks for this tip, lopalong  
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
Chaotic wrote: [View Post]
That worked perfectly!  Another idea would be to remove empty fields from the profile...any suggestions?

Thanks again Lopalong.


You're welcome.

I trust you mean this profile template? h**p://***.icyphoenix.com/profile.php?mode=viewprofile&u=3295

That's what I was mislead into answering in my first post as it invloves Db Queries something like:
 
if user_hobies==('') etc  DO THIS ->

else DO THIS INSTEAD ->>> etc, etc, .php files - templates and God knows what else?

Now I'm out of here, because that one is out of my depth.
 
 
 
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
KugeLSichA wrote: [View Post]
many thanks for this tip, lopalong  


You're welcome too!  

It only has one drawback, and that is if one wants to centre the text, then it has to be done "block-wise" with margins and fixed width; and it could end up looking pretty U.G.L.Y with any line that is just a little bit too long and wraps.

Me I like it centered as in the pic.

Untitled 2.png
Description:  
Filesize: 26 KB
Viewed: 106 Time(s)

Untitled 2.png


 
 
 
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
Lopalong wrote: [View Post]
Me I like it centered as in the pic.


yes, looks better...
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
I like how you have all the messenger icons under the avatar, but with our Xbox Live Gamercards and the Medal Mod under our avatars, it would look more crowded than it already is...LOL.

I do have some users that are putting whole sentences in their Location field.  It looks terrible.  Is there a way to limit how much text can be added to the Location field?  I think a city and state would be sufficient.
 




____________
| Icy Phoenix ColorizeIt! |
Bipolar Disorder - Not good for you and definitely not good for everyone else.
 
ChaoticSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
Chaotic wrote: [View Post]

I do have some users that are putting whole sentences in their Location field.  It looks terrible.  Is there a way to limit how much text can be added to the Location field?  I think a city and state would be sufficient.


Why not remove the field from viewtopic, as the same info is generated by hovering over the user's Flag?
 
 
 
Back to topPage bottom
Reply with quote Download Post 
Post Re: Hide Empty Fields 
 
You have a point.  I believe I will do that.

Thanks again buddy!
 




____________
| Icy Phoenix ColorizeIt! |
Bipolar Disorder - Not good for you and definitely not good for everyone else.
 
ChaoticSend private messageVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron