View Full Version : SIMILARTHREADS in SHOWTHREAD_SHOWPOST
imported_silkroad
07-20-2008, 08:08 AM
How do I get SIMILARTHREADS to work in SHOWTHREAD_SHOWPOST ?
I tried to simply put $similarthreads in the SHOWTHREAD_SHOWPOST but it did not work.
Thanks so much!
Dismounted
07-20-2008, 10:24 AM
You need to make sure the variable exists when that template is called.
imported_silkroad
07-20-2008, 11:24 AM
You need to make sure the variable exists when that template is called.
How do we do it for this simple question?
Thanks.
Dismounted
07-20-2008, 12:05 PM
Look in the file where the template is eval()'d, then find where $similarthreads is "created".
imported_silkroad
07-20-2008, 12:13 PM
Hi Dismounted,
This seems to be a very straighforward question, but you are just treating the answer like you really do not want to help, just posting one line answers at a time.
If you can't fully explain how to do it, kindly let someone post a reply who does not mind to take a few minutes to explain propertly.
If you know how to really do it, please simply provide the step-by-step details.
Thanks.
Dismounted
07-20-2008, 12:48 PM
You see, what I try to do is provide clues and guidance - it is much better if you can get someone to do something themselves, they usually go "wow, that was much easier than I expected". In addition, they learn and they know what to do in the future.
I will leave this thread now, for someone else to answer, as you have made it plain and clear you want a "just give me the answer" post.
imported_silkroad
07-20-2008, 01:04 PM
Yes, that is what we need, thanks.
Cryptic clues might be a fun game for some, but since we are really busy, all concerned would benefit from a basic, three line explaination of the details, so we (and others who might read in the future) can move on to the next topics.
Thanks for the clues, but this is such a very simple and basic concept, the community would benefit if there was just a straight forward explaination and real world example (like this one) so we can do it and move on.
Can someplease provides the basic steps to take a working template in SHOWTHEAD, $similarthread, and get it to work in SHOWTHREAD_SHOWPOST, in a straight forward, easy to understand way?
Thank you.
Digital Jedi
07-20-2008, 01:20 PM
That's because the answer is only one line. You know, I had no idea what he was talking about either (don't let the "coder" nonsense in my user title fool you), but a quick Google search for eval() explained it to me. Look for the file where $similarthreads variable is and the template name is beside that. I don't know what you do with it from there, but at least, try and find it. My wild undeducated guess is you just add the template name in beside it.
imported_silkroad
07-20-2008, 02:00 PM
Hi Jedi,
No, it is not just a one liner, I don't think. That is the problem sometimes here, folks could take the time, to teach if they really knew, but we just waste a lot of time because the documentation and tutorials are so poor.
ANYWAY (LOL)
In showthread.php there are only two eval statements associated with similarthread and both look like this:
eval('$similarthreads = "' . fetch_template('showthread_similarthreads') . '";');
I don't think it is obvious from this eval() statement how to get the template to work in the showthread_showpost template.
If this is so easy, why can't we just get a step-by-step reply?
There must be many tempates in vB that are used in one temlpate that can be used in another, and this question somes up time and time again, but I can't get a straight forward answer for months.
It's like "dud" it is so easy, but we are going to make you feel like an idiot for asking. What is up with that??
Digital Jedi
07-20-2008, 03:16 PM
No one suggested it was easy or that you were stupid for not knowing. I even said, I don't know. But, well, I mean, if you think about it, if it wasn't something you found in a search, that means it's not really been done before. If it's not been done before, then how can you get step-by-step directions? And if it's not been done before, then the best anyone can do is point in the right direction through an educated guess. The way you phrase it, you sound like your asking for it to be done for you. For most problems, it's a matter of you working it out, and coming back with your results if it doesn't work. That's the way most of us here sort out issues when trying something new.
imported_silkroad
07-20-2008, 03:50 PM
Hey Jedi,
I hear what you are saying; but I see it differently.
Basically, the way I see it, it is just a generic vB issue that is so common it should be in a FAQ.
For example, if I have a routine in any programming language (A), and that routine calls another routine (B) and I want to call (B) from (C), is is pretty straight forward and a basic part of coding.
So, in vB you have template (A) and template (A) calls template (B); and we want template (C) to call (B), what are the steps to do it?
At the right level of abstraction, it does not matter if we say it is $similarthreads or $showthread or $poll or $navbar or $header or $whatever. The basic idea is that we have a function and it works in one tempate and we want to call it from another one.
I don't really understand why folks here can't explain it.
(1) Go here, look for this and that;
(2) Then, take this and add that.
(3) Etc.
After all, I find this problem every day, I want to add a template to another part of the code and each time I ask this question I never get a straight forward programming answer; and the answer does not lie in the docs, cause I know where the docs are and how to search them.
If it was in C, it would be so easy; because the first few chapters of the documentation explains this simple concept and gives simple examples!!
Princeton
07-20-2008, 03:59 PM
everyone here is a volunteer
with that attitude - do you really think that you are going to get any help?
imported_silkroad
07-20-2008, 04:05 PM
I don't think I have an attitude, I think I am asking a straight forward question and not getting any useful answers.
For example, here is a similar post with no response:
http://www.vbseo.com/blogs/sinucello/optimize-single-post-template-seo-131/
The poster has the same problem, he wants to use $header and $navbar in $showthread_showpost and he never gets an answer.
So, it does not matter what "attitude" you have, because I have asked this in other forums and seen other people ask, and they do not get answers.
This is a very straight forward question, not a game.
Instead of posting about "attitude", how about an answer, LOL. I guess you guys just don't know, because if you did, you could answer. So, why waste time answering if you haven't a clue, LOL.
RLShare
07-20-2008, 04:14 PM
Why do you even post here if you think noone has a clue to what their doing?
Look at the eval you found. All of the code around that fills variables that are used in the template thats fetched to fill $similarthreads. Your looking at how its filled, if its not showing up when you put it somewhere else then the variable is not getting filled with data before that template is fetched. SO WHAT YOUR LOOKING AT IS HOW YOU WOULD GO ABOUT FILLING IT SO YOU COULD USE IT SOMEWHERE ELSE and if you cannot understand that you should not be posting here asking for help. You should be posting asking for someone to do it for you in one of the request forums.
imported_silkroad
07-20-2008, 04:26 PM
You are absolutely right.
I should not be wasting my time posting this question here. I thought you guys were much more talented.
I don't want to waste your time or mine.
I can do it myself vs. all this blah, blah, blah..... a total waste of time.
--------------- Added 1216575103 at 1216575103 ---------------
Sorry to have wasted your time.
No need to reply.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.