• Welcome to Simple Machines Community Forum. Please login or sign up.
December 06, 2021, 01:37:01 AM

News:

SMF 2.1 RC4 has been released! Try it out and help us test! :) Read more.


Add a new link into the mini profile

Started by wynnyelle, April 14, 2013, 09:33:29 PM

Previous topic - Next topic

wynnyelle

I'm sorry again...I lost track of where I started. :(

Let me go back now. I am seeing the image, but maybe I just got lucky. I don't want to use bad syntax, anyway. It probably makes problems.

hcfwesker

If you just add the code as it was posted just a bit ago ( and upload that image to Themes/default/images folder .... the image will show.

wynnyelle

Please don't be angry but the code did not show the image, so I put it back t the code I have, which does show it. I know it worked for you, maybe different codes work for our different sites...I'm so sorry. But you did help me a lot with this, it now shows up and has the image. I know you said it's impossible but there it is.

Here is what it looks like!

Now, should I create a new thread for how to put it on the profile page?

hcfwesker

exactly what code are you using now? paste so i can see, cause i know its not the same you pasted a bit ago.  <img src="/Images/blogicon.gif"/> wiil not call for an image to be displayed, i will go to my grave defending that statement lol

and reason why mine probably didn't show was because you skipped this step
Quoteupload that image to Themes/default/images folder

wynnyelle

Sure here it is:


// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender']))
echo '
<span class="gender">',$message['member']['gender']['image'],'</span>';

// Show how many posts they have made.
if (!isset($context['disabled_fields']['posts']))
echo '
<span class="postcount">',$txt['member_postcount'], ': ', $message['member']['posts'];
echo'<li><a href="?action=pmxblog;sa=view;uid=', $message['member']['id'],'"><img src="/Images/blogicon.gif"/><span class="image_link">Blog</a></li>';
echo'</li>';

echo'<li><a href="?action=profile;area=pictures;u='.$message['member']['id'].'"><img src="/Images/image_icon.gif"/><span class="image_link">Image Gallery</a></li>';

// Begin SMFShop 2.3 (Build 11) code


I hope you don't mind I included the code arond it.

Oh, that would be why!! I'm sorry. Let me go upload it.

I realised that if I put the member's name on this link people would wonder why it was not also in front of the image gallery link. I just want them to match.

hcfwesker

<img src="/Images/image_icon.gif"/><span class="image_link">   <--- ok, now THAT will produce an image
<img src="/Images/image_icon.gif"/>  <--- THAT, which you originally had, will not lol.  i see what you were trying to do now

Well, yeah, I would have just used the word "Blog" as well since you know it belongs to that member's mini=profile.  but 9 times out of 10 you always try and do everything fancy dancy lol, so i just added the phrase with the name for starters

for profile, it should work the same, just change $message to $context  in the code and should be good to go

wynnyelle


wynnyelle

It doesn't work. I replaced it with context instead of message and the whole profile will not display now. Only this


Parse error: syntax error, unexpected '>' in /home/develop/public_html/Themes/default/UltimateProfile.template.php on line 308

hcfwesker

can you supply me with some pasted code of the area you're trying to put it in?  may not need <li> , may need <dt> or something else ; just paste some of the code you're trying to insert it around

wynnyelle

Sure!



if (isset($context['member']['subaccounts_posts']))
echo '
<dt>', $txt['subaccount_posts'], '</dt>
<dd>', $context['member']['subaccounts_posts'], ' (', $context['member']['subaccounts_posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
}
echo '

<dd>', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</dd>
// Member Blog Links ...
echo '
<li>', $context['member']['name'], '\'s <a href="', $scripturl, '?action=pmxblog;sa=view;uid=', $context['member']['id'], '"/><img src="', $settings['default_images_url'], '/blogicon.gif" />Blog</a></li>';
<dd><strong>', $txt['date_registered'], ': </strong>
', $context['member']['registered'], '</dd>
<dd><strong>', $txt['lastLoggedIn'], ': </strong>
', $context['member']['last_login'], '</dd>

hcfwesker

LOL!   I'm sorry, not meaning to laugh, but gonna give ya an echo statement lesson real quick.  You can't break up an echo statement. 
echo'
';

you can't just throw code inbetween those 2 without knowing what you're doing.  Let alone add ANOTHER echo' '; inbetween that, THATS why you're forum is crashing.

This is what you're trying to do ...  echo'  echo'  ';  ';   and that's not gonna happen

Gimme just a second

hcfwesker

Replace
echo '
<li>', $context['member']['name'], '\'s <a href="', $scripturl, '?action=pmxblog;sa=view;uid=', $context['member']['id'], '"/><img src="', $settings['default_images_url'], '/blogicon.gif" />Blog</a></li>';


With this

<dd><a href="', $scripturl, '?action=pmxblog;sa=view;uid=', $context['member']['id'], '"/><img src="', $settings['default_images_url'], '/blogicon.gif" /><strong>Blog</strong></a></dd>


wynnyelle

It broke it :(

I got this



Parse error: syntax error, unexpected '>' in /home/develop/public_html/Themes/default/UltimateProfile.template.php on line 308

hcfwesker


wynnyelle

Ok. I'm really sorry it didn't work yet, I swear I didn't change it...please don't be angry... :(

This copy has the added code taken back out, because it was broken anyhow. If you want a copy with it in, I can send that too.

hcfwesker

Try this.  just make sure you have the image uploaded where i told you to.

wynnyelle

It has a whole bunch of gook now where the link should be, but the profile is still intact otherwise. I just uploaded your file that is all I did.

Maybe once I upload the image, it'll fix that mess. If not, I will show a screenshot.

thank you again!!

hcfwesker

just show me the screen shot now, been here for 2.5 hours :P  and make sure you uploaded the image as blogicon.gif

all i did was change this
<dd>', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</dd>
<dd><strong>', $txt['date_registered'], ': </strong>

to this
<dd>', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</dd>
<dd><a href="', $scripturl, '?action=pmxblog;sa=view;uid=', $context['member']['id'], '"/><img src="', $settings['default_images_url'], '/blogicon.gif" /><strong>Blog</strong></a></dd>
<dd><strong>', $txt['date_registered'], ': </strong>

wynnyelle

here

and the link doesn't go to the blog. i thought i should say that. cause you can't really tell from the screenie.

hcfwesker

of course it won't goto the blog because that part of UP doesn't call for $scripturl links

change
function up_block_summary() {
global $settings, $txt, $context, $modSettings;


to this
function up_block_summary() {
global $settings, $txt, $context, $modSettings, $scripturl;

Advertisement: