News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

any way to do an "include" ?

Started by supernova777, August 22, 2014, 03:20:56 PM

Previous topic - Next topic

supernova777

i have created a series of posts and made a "nav bar" of some sorts to navigate between the interelated posts
using [iurl] to focus the same window..

but if i change my nav bar i have to edit it on every single post.
is there a way to include a bunch of text somehow from an external source?
so that i dont have to edit more then one file to make a change in my series of links?

here is the example:
http://www.oldschooldaw.com/forums/index.php?topic=156.0
at the top i have links to different posts that are the same on each page

Ninja ZX-10RR

Wait... Nav bar? What is that? What did you edit? You have to provide way more informations about this... All I can see there are just a few links in the topic, not really a "nav bar"...  But IMO it's not really a big deal copy/pasting the source text in every topic if you want to have those links... ;)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

kat

I had a load of text and links. in my header. What I did, was create another php file and called it by putting include 'topbit.php'; in index.template.php.

Is that similar-ish to what you want?

Kindred

well,... for one. NO. You can not and never will be able to "include" a php file within a post.

You would have to (and should have, in the first place) edit your display.template.php to insert your "navbar" the correct way, in the posts display generation routine
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

kat

Per post... I must be going through a "Let's misunderstand posts" phase...


Burke ♞ Knight

Hmm... Correct me if I'm wrong, but wouldn't Related Topics mod be better?

QuoteRelated Topics adds listing of "Related Topics" or Similar Topics on topic view.
Method used to create listing can be changed from Admin. (Currently only one option)

supernova777

i was thinking i could just use a simple bbcode for this? is there a character limit on how much text u can put into a bbcode definition?
i could just make [nav1] bbcode in my admin and then edit it in the bbcode definition and it would get added to all my threads...

right?


Arantor

Yes, that would work. There is no practical limit on the content that can be added inside a bbcode definition. Note that you would have to use raw HTML rather than bbcode inside that bbcode, if that makes sense.

Adding a bbcode is not the most complex thing but it's not the simplest. What HTML were you planning on adding? Once I know that, I can write you the relevant bbcode definition.

supernova777

Quote from: ‽ on August 23, 2014, 09:11:38 AM
Yes, that would work. There is no practical limit on the content that can be added inside a bbcode definition. Note that you would have to use raw HTML rather than bbcode inside that bbcode, if that makes sense.

Adding a bbcode is not the most complex thing but it's not the simplest. What HTML were you planning on adding? Once I know that, I can write you the relevant bbcode definition.

hmm for this specific purpose.. using raw html would almost be preferable!!!

well i just was adding links to jump to different related topics. but it was not practical to edit more then 7 files just to make a change in my code.. so naturally i wanted to centralize it in 1 location instead of 7+

(see my original link to my forum)

Arantor

Yes but I still need you to tell me what the HTML is so I can write you the changes to Subs.php to build this [nav1] bbcode you're talking about.

supernova777


Ninja ZX-10RR

I believe he asked for he html itself and not a link to a topic you had already linked before...
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

supernova777

Quote from: ♦ Ninja ZX-10RR ♦ on August 24, 2014, 06:49:15 PM
I believe he asked for he html itself and not a link to a topic you had already linked before...

it isnt in html.. its just in the post.. as bbcode or whatever u call the type of code that goes into any old post..

can i ask a quick offtopic question?
i noticed on a page i was reading about this type of formatting
using | characters to create tables, is this some sort of standard markup?
is there a mod i can install to use this type of markup? i edited a post on wikipedia just last nite and noticed that they also use it there with 1 pipe character meaning something different then || two pipes together to  create a border? anyways this type of markup is much faster for people creating content and allows them to focus on the content rather then trying to properly layer [table] [tr] [td] tags  - if one of u kind gentlemen could let me know what this is so i can look up a way to install it .? or perhaps its already supported? my forum uses 2.08 smf i believe?

supernova777

Quote from: Kindred on August 23, 2014, 01:19:28 AM
well,... for one. NO. You can not and never will be able to "include" a php file within a post.

You would have to (and should have, in the first place) edit your display.template.php to insert your "navbar" the correct way, in the posts display generation routine

this isnt what i meant.. i dont want to include a php file.. i was referring to the include to refer to its method of use, to keep some text (be it markup or not) in one central spot so that i can easily edit that content and have it update in all the seperate posts to which it is embedded
in the same way that someone would use an include on a php development project as to avoid having to edit multiple files everytime content is updated.

the navbar that im talking about isnt something i want global/site wide its just a way to quick jump between a bunch of posts that are interrelated .. im using my forums site pretty much like an interactive wiki:)

Kindred

ah... in that case... no, there is not really anything you can do about that.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

supernova777

Quote from: Kindred on August 27, 2014, 06:17:51 AM
ah... in that case... no, there is not really anything you can do about that.

yes there is didnt u read above, a bbcode can be used for the same purpose
only i keep the selected code in the bbcode definition
and add to multiple posts ..... why do u bother to answer peoples posts if u seriously dont have any answer for them.. is that what u do? u go around posting on other peoples questions to make yourself feel authoritative + smart:? meanwhile u dont give it but a moments thought?
lol

Ninja ZX-10RR

Quote from: supernova777 on August 27, 2014, 03:27:56 PM
Quote from: Kindred on August 27, 2014, 06:17:51 AM
ah... in that case... no, there is not really anything you can do about that.

yes there is didnt u read above, a bbcode can be used for the same purpose
only i keep the selected code in the bbcode definition
and add to multiple posts ..... why do u bother to answer peoples posts if u seriously dont have any answer for them.. is that what u do? u go around posting on other peoples questions to make yourself feel authoritative + smart:? meanwhile u dont give it but a moments thought?
lol
I'll try to be kind and kindly tell you why you messed up there. I call that BS.
If there is not a real answer NOBODY will ever be able to give it to you, obviously. And no despite he is very serious (a bit too much IMHO sometimes) he answers 99% of the times correctly and he has his position for a reason.
Stated this, I don't want to look like a fanboy or an attorney, you could have said what you said above to anyone in here and I would have told you almost the same thing. Additionally addressing a staff member like that is not really polite.

From my very first answer I had the feeling it would have ended up with no solution but I was watching to see if I could learn something new myself but nothing, just found a non-sense, lying and off-topic post and no real solution to the problem itself.
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Kindred

Actually, I did read above. Apparently you did not...  Because what the offer to help you with is very different from what you ended up asking for in the most recent version if your description.

Let me put it to you this way...    Almost anything CAN be accomplished, if you know how to code it. However, what you describe in your most recent description is much more complicated than what you originally described... And thus, significantly fewer people could do it for you.  And with an attitude like you showed right there, the one or two that could do it for you are even less likely to do so.

Basically, you are trying to make the system do something that it is not intended to do.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

supernova777

there was a solution.. i used a custom bbcode to store the code and used the tag in each of the posts
this allowed me to change the code (and update the links) only once and have it change in all 10+ posts

8)

Advertisement: