PDA

View Full Version : Profile Customization $block_data


GCSkye
05-31-2009, 11:26 PM
I am currently working on custom profiles on my site. I'm trying to get the last visitors on the page to display at the top, you can see it is blank. I have it at the bottom working using the following code:

$blocks[visitors]

Profile can be found here:

http://evercube.net/forum/members/skye.html

I ripped apart the template it calls for to make the top part. Code being the following:

<div class="alt1 smallfont block_row">
<phrase 1="$block_data[visitorcount]">$vbphrase[last_x_visitors]</phrase>
<ol class="list_no_decoration last_visitors_list">
$block_data[visitorbits]
</ol>
</div>


I tried changing the block_data in the code to other things like vbphrase and userinfo but had no luck.

I need an alternative to get the code working or a way for when I post $blocks[visitors] it doesnt show the top bar with the text Recent Visitors on it.

Thanks,
Skye

andrewtr89
05-31-2009, 11:33 PM
I agree.

Lynne
05-31-2009, 11:54 PM
I tried changing the block_data in the code to other things like vbphrase and userinfo but had no luck.
Exactly what do you mean by this - you changed your code to look like what?

GCSkye
06-01-2009, 01:42 AM
$block_data[visitorbits] to

$vbphrase[visitorbits] and $userinfo[visitorbits]

Lynne
06-01-2009, 02:43 AM
I'm not getting a good picture of what you want. I see how you've moved it over to the left side, but now you want to move it to the top of the left side? I'm really not getting a good idea of what you want and what you have tried.

GCSkye
06-01-2009, 03:19 AM
Where ever I post $blocks[visitors], I get the following:

http://evercube.net/recent.png

The code for this in the memberinfo_block_recentvisitors template is:

<if condition="$block_data['visitorcount']">
<div class="alt1 smallfont block_row">
<phrase 1="$block_data[visitorcount]">$vbphrase[last_x_visitors]</phrase>
<ol class="list_no_decoration last_visitors_list">
$block_data[visitorbits]
</ol>
</div>
</if>
<div class="<if condition="$block_data['visitorcount']">alt2<else />alt1</if> smallfont block_row block_footer">
<phrase 1="$prepared[profilevisits]">$vbphrase[this_page_has_x_visits]</phrase>
</div>

Viewing that script posted above, you will noticed it doesn't contain the bar that says Recent Visitors [-], but it shows up in the Members profile still. I don't want it. How do I post the last 10 visitors without having that bar.

As I said before. The top bar I tried to add, I used this code:

<div class="alt1 smallfont block_row">
<phrase 1="$block_data[visitorcount]">$vbphrase[last_x_visitors]</phrase>
<ol class="list_no_decoration last_visitors_list">
$block_data[visitorbits]
</ol>
</div>

Instead of $blocks[visitors]. The only problem is, it doesn't work. I need it to work.

Lynne
06-01-2009, 04:04 AM
The "Recent Visitors" part of that is in a different template. It's in memberinfo_block. That is the basic template that holds the specific templates for the different blocks. I have a feeling you will have to do a few code changes in order to get this how you want it.... or put a condition around that area in memberinfo_block that says if it's for the visitor block, then not to show it. I'm not sure what that condition would look like though. You'd have to play with it.

GCSkye
06-01-2009, 09:10 PM
That if statement is seeming like a no go for me atm. Been playing with it for a while and can't seem to get it going.

Looking at the script I ripped from the memberinfo_block_recentvisitors template, is it possible to have it display in the memberinfo template on its own?

Here is what I have for it in my member info as of right now:

<div class="alt1 smallfont block_row">
<phrase 1="$block_data[visitorcount]">$vbphrase[last_x_visitors]</phrase>
<ol class="list_no_decoration last_visitors_list">
$block_data[visitorbits]
</ol>
</div>

When looking at the profile you see that it shows the $vbphrase[last_x_visitors], but it isn't displaying the $block_data. Anyway to fix that?

Edit: Basically, I need $block_data[visitorbits], $block_data[visitorcount] to work no matter where I post it in memberinfo.

Lynne
06-01-2009, 10:04 PM
You may try looking at the code around line 360 in member.php. The actual template is evaled closer to line 473. I'm not sure if you can use the hook right above there to change things or if there is another better hook to use where you could change things (hooks are on the bottom of the page when in debug mode). You may want to just take it out of the template ($blocks[visitors] line in MEMBERINFO) and write your own template to use in insert it in there where you want.

GCSkye
06-01-2009, 10:09 PM
Are you saying just put the following in a different template:

<div class="alt1 smallfont block_row">
<phrase 1="$block_data[visitorcount]">$vbphrase[last_x_visitors]</phrase>
<ol class="list_no_decoration last_visitors_list">
$block_data[visitorbits]
</ol>
</div>

Will that work?

Lynne
06-01-2009, 10:15 PM
I don't know since I have never tried to do what you are doing. I would probably try to do the template edit, but you said you couldn't figure that out, so I was suggesting just writing your own code to do what you want and spitting it out in your own template. You will probably have to eval the template using the hook I mentioned and then you'll have to add it in somewhere into MEMBERINFO.

GCSkye
06-01-2009, 10:27 PM
I'm not so strong with the if statements, do you have an idea what I would put to prevent it from displaying the topbar just for recent visitors?

Lynne
06-01-2009, 10:34 PM
I already said I wasn't sure and that you'd have to play with it. Looking at the template though, I'd guess you could use the variable "$id" Look in the page source and you can see what the id is for each of the blocks and then simply use it for the condition.