I want to add a link into everyone's mini profile that leads to their blog, if they have one {if not it would just lead to the blog page in general or something}. The blogs are an add-on, but they all contain the same type of link since it's just one per profile. Looks like this:
Quote
http://warriorcatsrpg.com/index.php?action=pmxblog;sa=view;uid=299
With the 299 being whatever the person's profile ID number is {that's just my own number for example}. I would think this is doable fairly easily as a link, but I am not sure so I thought I would post here.
For people with no blog, it should redirect to the main blogs page, right now it appears to create a non functional blog page when sent to the blog page of someone who does not have a blog. Their profile shows up as the owner of a non-active blog, but below it is a blog creation page that doesn't function. I just want it to redirect to the main listing page.
If that's too off-topic for this, don't worry, I just want to create the mini profile link and then I'll work from there.
The redirect for a member with no blog is out of the question for me ( havent seen this MOD in action at all). But try this for linking to member blogs from mini-profile
Just add wherever you want in Display.template.php
// Member Blog Links ...
echo '
<li>View ', $message['member']['username'], '\'s <a href="', $scripturl, '?action=pmxblog;sa=view;uid=', $message['member']['id'], '"/>Blog</a></li>';
You can reword it however you want. this should mnake it appear as ::
View Groovystar's Blog (http://warriorcatsrpg.com/index.php?action=pmxblog;sa=view;uid=299)
OMG thank you! I'll try it in the ultimate profile too since I want to add these blog links there, too. I'll post back here letting you know how it goes.
Haven't heard from you in a while hope you are doing well.
Been doin good :) it has been awhile lol
for Ultimate Profile, needs a little change. both places that has $message, change them both to $context
// Member Blog Links ...
echo '
<li>View ', $context['member']['name'], '\'s <a href="', $scripturl, '?action=pmxblog;sa=view;uid=', $context['member']['id'], '"/>Blog</a></li>';
Unfotunately this code did not work properly, but it did wind up displaying the member's true username, which is a large no-no. Only the display name should ever show, as the true username is something that a member may or may not allow others to see.
I just tried it in another place and it is doing the same thing I can't use this.
Also the word Blog never shows up, so there is no link.
Use $context['member']['name'] instead of $context['member']['username']
// Member Blog Links ...
echo '
<li>View ', $message['member']['name'], '\'s <a href="', $scripturl, '?action=pmxblog;sa=view;uid=', $message['member']['id'], '"/>Blog</a></li>';
EDIT: yeah, like Arantor said lol
Quote from: Groovystar on April 14, 2013, 11:09:56 PM
I just tried it in another place and it is doing the same thing I can't use this.
And this is honestly why I usually avoid your topics cause you crack and break down at the first sign of it not going exactly as you planned lol. Some codes take a little trial and error ... especially when it's something custom, some people NEEEEEEEEEEED to try and be patient and allow the person trying to help to work around the issue before breaking down. Yikes!
The code works, I promise you, as I just tested it myself.
I didn't break down. I was just saying I couldn't use it. I'm on my testing site anyway so nobody is suffering for it. I'm sorry if it looked like I was.
I will try again. Oh and thank you too Arantor!
Okay. I tried it again. The problem is that the word Blog {the link area} is still not showing up.
Should the whole thing be before or after the other "Echo"'s in the coding?
use thie updated code from earlier
// Member Blog Links ...
echo '
<li>View ', $message['member']['name'], '\'s <a href="', $scripturl, '?action=pmxblog;sa=view;uid=', $message['member']['id'], '"/>Blog</a></li>';
It's working as it should. The example in the pic is of a member that has had 1000 name changes, and shows his changed username
Hm, ok. I'll wipe the code I was using and just do a direct re-paste. I think I did something screwy when I was moving it around in different places.
Thank you for being patient with me.
Also, something seems kinda strange when viewing any board on your site. It's nothing to panic over, but some reason your topics don't show view count totals in the Replies/View colimn for any topic that's not a sticky, even if it has replies it only shows 0 views.
http://warriorcatsrpg.com/index.php?board=7.0
15 Replies
0 Views
Just seems strange since it has 15 replies it should have at least 15 views
Yeah...we took that out to save space. We have some bad lag problems. It didn't work, but it'd be a pain to put them back :P
The code now I am trying on the profile and it only kind of....makes the entire profile not load at all? Just shows an error on a white screen of death. :P
This is the code I am trying to inset
echo'<li><a href="?action=pmxblog;sa=view;uid=', $message['member']['id'],'"><img src="/Images/blogicon.gif"/><span class="image_link">Blog</a></li>';
ok, when you edit a code i supply, and complain it doesn't work, that's NOT my fault. you're trying to insert an image which you have it all wrong in the way you're trying to. post a link to the image so i can give you the correct code none of your > have closings on them like /> which i see you took out of my original code
Try this code for the added image. please try and specify all you're trying to do with something. It just kinda irritates me to know my code was working when you say it doesn't then to see why, cause you were trying to add something to it that has no possible way of working with how you tried to modify it :P
// Member Blog Links ...
echo '
<li>View ', $message['member']['name'], '\'s <a href="', $scripturl, '?action=pmxblog;sa=view;uid=', $message['member']['id'], '"/><img src="', $settings['default_images_url'], '/blogicon.gif" />Blog</a></li>';
Make sure to have that blogicon image uploaded to your Themes/default/images folder
I didn't take it out. I put some of your code into a part of code that I already had in there. I'm just trying to get this to work that is all.
It actually is working on the mini profile now, but it won't on profiles.
The image link is http://dev.warriorcatsrpg.com/Images/blogicon.gif
I'm sorry if I didn't do this right.
I added your code to the profile exacly, but now it white screen of death, and this exact error:
Parse error: syntax error, unexpected '>' in /home/develop/public_html/Themes/default/UltimateProfile.template.php on line 309
Please don't be mad...I really am trying, hard. I apologise if I did anything wrong this time.
I know, and I commend you for trying. but its the fact im running in circles trying to find out why my code doesnt work for you ... when i tested it an hour ago and it worked ... THEN to find out why it doesn't work for you, because you tried modifying it.
<img src="/Images/blogicon.gif"/> <--- that will in no way produce an image
/Images/blogicon.gif <--- according to how the above it written, that's suppose to be an image link, which it won't ever be
Quote from: Groovystar on April 15, 2013, 12:11:19 AM
I added your code to the profile exacly, but now it white screen of death, and this exact error:
Parse error: syntax error, unexpected '>' in /home/develop/public_html/Themes/default/UltimateProfile.template.php on line 309
Please don't be mad...I really am trying, hard. I apologise if I did anything wrong this time.
Ummmm ... i never said anything about profiles yet. This is for mini-profiles like you originally asked
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.
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.
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?
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
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.
<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
Really? Okay, let me go try it then :)
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
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
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>
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
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>
It broke it :(
I got this
Parse error: syntax error, unexpected '>' in /home/develop/public_html/Themes/default/UltimateProfile.template.php on line 308
omg! just attach your file
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.
Try this. just make sure you have the image uploaded where i told you to.
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!!
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>
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.
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;
That worked.
You're a genius.
thank you so much!!
I have more stuff I need, but you've helped a while and I'll just start a new thread for that stuff.
you're welcome. I'm going to bed :D good luck with the other stuff
thank you :)
Okay, actually I'll continue this for anyone who knows, and wants to take a turn at this. There any way to make these links not show up at all if a member doesn't have a blog?
Quote from: Groovystar on April 15, 2013, 01:57:05 AMThere any way to make these links not show up at all if a member doesn't have a blog?
cant tackle it right now, but since there are settings for this that each member has to activate it, then you'd just add an if state for it to not display for those who haven't activated it. But, as i said,since i haven't seen the MOD or its files then I wouldn't know right off the top of my head. It'd be something like
if(whatever the blog settings label is ) > 0
echo'<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>';
This is just randomnly giving an idea, do NOT literally use that code
You should ask Feline what setting is set to determine if a user has an active blog or not
then just use that in an if - then - else statement
if ($userblog!=0) {
echo 'blog display code';
} else {
echo 'link to create a blog';
}
Thanks! Yeah this does need to be solved somehow since it is crating an error when someone tries to access a blog that isn't public, too, I think. I am not certain, but when I see the error again I will post it. Who is Feline, do you have their profile link?
Feline is the author of the PMXBlogs mod
Is she on this site?
I jioned the portamx site, and posted a bunch of questions there but didn't get a response.
can you attach the mod zip here, i don't know if it's allowed, worse case scenario it'll be removed by a staff member but I'll have it downloaded before that happens and take a look at the files myself ( or post a direct link to the download page for this MOd you're working with). Just know, the option you asked for in another topic about "activating blogs by default for members" will cancel out this option. so you gotta choose one or the other, unless there's a work around
no. Do not attach the mod.
The mod can be downloaded from the PMX github...
Once you identify what variable tells the system who has a blog and who does not, it's a pretty simple IF statement...
googling "PMX github" brings up no links dealing with a blog/portal mod of any sort.
yeah, figured it'd be like... if blah blah = 1 "print blog link" else blah blah =0 "print link to activate blog" , the shorthand "gist" version lol
Quote from: hcfwesker on April 15, 2013, 04:22:35 PM
googling "PMX github" brings up no links dealing with a blog/portal mod of any sort.
http://portamx.com/ The download link is at the top of the page ;)
I got this at the top of my search...
PMX (Peter Marx) ยท GitHub
https://github.com/PMX
and since the mod author was referred to as a girl, I didn't think peter marx was the link lol. looked down the search list and clicked the links but never found it.
thanx for the direct link, I'll look into it later.
It's the blog download you want :D Try this https://github.com/PortaMx/PmxBlog-1.1
I just got in. If you can't find where the blog is downloaded I can go get the link I used.
I got it, but won't install on my 2.0.4 test forum. looked at the settings file, and not being abe to see it on the page myself, best option for the IF statement I can pick out is 'blogenabled'
$txt['PmxBlog_blogenabled'] = 'Enable Blog: ';
<td align="right" width="45%" style="padding-top:10px;"><b>'. $txt['PmxBlog_blogenabled'] .'</b></td>
<td width="55%" style="padding-top:10px;">
<input class="check" name="blogenabled" type="checkbox" value="1"', isBlogEnabled() ? ' checked="checked"': '', ' />
I don't know if this is a member setting to activate their own blog, or admin setting to enable blogs for members
G-Star, give me a screencap of the member settings to activate their own blog
EDIT:::
NM, I found it, and Yes, the code I pasted above is for where member's select to Enable there Blog
Oh so this code will set blogs and posts to auto-enabled and published by default? Thank you!
Uh...where do I put it? ^_^;;;
I have the blog's files open on my computer now. Just looking through them seeing what I can do, if anything.
We got another problem with the blogs.
The blogs page {where all the blogs are listed} lists them in alphabetical order, apparently.
I am a bit in disbelief...this is a terrible idea. And before long, it's going to create serious problems. So...can I change this to most recently updated blogs being at the top? That really makes the most sense and seems to me like it would be fairly simple.
hcfwesker,
I don't think that will work, because there is no ID included in that blog enabled check... I think that is "did the admin turn on the blog feature" not "does this user have a blog"
Groovy
this has gone way beyond support of SMF and I am going to direct you to Feline now -- All further questions on how the PMXBlog works should be done on the PortaMX support site (especially since the mod is not even available for download from our mod site)
The code I posted was NOT meant for use, Groovystar ( read carefully and try not to get ahead of yourself and everyone else ;) ) .
Quote from: hcfwesker on April 15, 2013, 04:39:23 PMthe code I pasted above is for where member's select to Enable their Blog
I was just posting it to show the portion of code where members chose to "enable their blog" so we could gather an IF statement thing for your profile link.
And, yes, I agree, this goes way beyond SMF 2.X Support, kinda gettin out of hand for a custom MOD made available outside of SMF
Nobody is answering me at all over there. Not one reply.
You guys have been great though! Thank you again.
I realise this is important to you, but please listen to what I said before.
Feline is *one person* and is in Germany - so the timezone is some hours ahead of yours - it's gone midnight there. You posted Sunday evening, bumped a few hours later in the early hours of Monday morning, it's now the early hours on Tuesday morning (gone midnight there) - and as I said, Feline is just one person. Please have a little patience.
And I am sure that she will respond when she can. I have always found feline to be responsive and helpful. She wants her mods to work correctly... She even helped me convert another article system into portamx articles and configure the test site which I had set up to test the portal.
Just for future reference, when using new MODs/features ... keep them on your test site for a couple/few days, and have 3-4 members completely dissect all the features/options as if they were members using and abusing it basically to every extent the feature offers. so you can see how everything works, and what you need to configure BEFORE adding it to your live site. A delayed (getting the custom kinks in effect) feature will always be better than a rushed ("oh no what do we do now") feature for members.
Thanks for the advice guys :) Sounds like she's overloaded. I will be patient and wait.