This wiki is a XML full dump clone of "Heroes Wiki", the main wiki about the Heroes saga that has been shut down permanently since June 1, 2020. The purpose of this wiki is to keep online an exhaustive and accurate database about the franchise.
Template talk:NovelsCreated: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Ryangibsonstewart |
imported>MiamiVolts |
||
| Line 13: | Line 13: | ||
***** Yeah, I noticed that the extra text is always before the * character, so my first idea is to pass through the string produced and nullify the text before each new line and the * character. Just trying to think up the correct use of pos and replace now; though now I think about it more it looks like there is no way to strip the different variations in one pass, and that it would take two dpl calls; good call.--[[User:MiamiVolts|MiamiVolts]] ([[User_talk:MiamiVolts|talk]]) 03:53, 19 December 2007 (EST) |
***** Yeah, I noticed that the extra text is always before the * character, so my first idea is to pass through the string produced and nullify the text before each new line and the * character. Just trying to think up the correct use of pos and replace now; though now I think about it more it looks like there is no way to strip the different variations in one pass, and that it would take two dpl calls; good call.--[[User:MiamiVolts|MiamiVolts]] ([[User_talk:MiamiVolts|talk]]) 03:53, 19 December 2007 (EST) |
||
*I'm not sure what the reason is, but I'm noticing either formatting problems or actual content problems on every single page using this template. I'd much rather go back to using the second template. -- {{User:Ryangibsonstewart/sig}} 06:33, 19 December 2007 (EST) |
*I'm not sure what the reason is, but I'm noticing either formatting problems or actual content problems on every single page using this template. I'd much rather go back to using the second template. -- {{User:Ryangibsonstewart/sig}} 06:33, 19 December 2007 (EST) |
||
** Yeah, still trying to figure out a better DPLSearch using recursion, so you have seen some disparity while I tried to change the format. However, I haven't got it to parse yet, so I commented it out momentarily to get some rest. I try some more on it in a few hours.--[[User:MiamiVolts|MiamiVolts]] ([[User_talk:MiamiVolts|talk]]) 11:02, 19 December 2007 (EST) |
|||
== Recursion == |
== Recursion == |
||
Revision as of 16:02, 19 December 2007
We can actually move (or alias) this and put the episode sections in here, too, so that one template call prints all applicable sections.--Hardvice (talk) 02:03, 19 December 2007 (EST)
- I thought about that too, but it seems like a waste to go through the novels and episodes for each person, when most people only do one or the other.--MiamiVolts (talk) 02:06, 19 December 2007 (EST)
- It would be a nice way to catch when, say, an episode writer writes her first GN. I have a feeling this automation is going to make us a bit lazy, and it's likely we'll forget to go and add the template for the other function. But then again, I guess it's no more likely than forgetting to add the new variable to crewnav.--Hardvice (talk) 02:08, 19 December 2007 (EST)
- Well, this template actually already does 4 searches for every pageload. If Admin thinks it's okay to do both, it's fine with me but I really do worry about taxing the server and the resulting performance in terms of speed.--MiamiVolts (talk) 02:11, 19 December 2007 (EST)
- I was able to modify Template:DPLSearch to use this template. Who is left to switch over from the graphic novel crew? Also, another thing we could do is to make the episode and graphic novel checklists dynamic such that they note where the NovelsCreated/EpisodesCreated template needs to be added. DPL opens a lot of possibilities.--MiamiVolts (talk) 02:56, 19 December 2007 (EST)
- Well, this template actually already does 4 searches for every pageload. If Admin thinks it's okay to do both, it's fine with me but I really do worry about taxing the server and the resulting performance in terms of speed.--MiamiVolts (talk) 02:11, 19 December 2007 (EST)
- It would be a nice way to catch when, say, an episode writer writes her first GN. I have a feeling this automation is going to make us a bit lazy, and it's likely we'll forget to go and add the template for the other function. But then again, I guess it's no more likely than forgetting to add the new variable to crewnav.--Hardvice (talk) 02:08, 19 December 2007 (EST)
Multiple creators
The code is breaking for when there are multiple artists or writers for a single novel, such as on Joe Pokaski's page. Trying to figure out a solution. Hmm.--MiamiVolts (talk) 03:20, 19 December 2007 (EST)
- It's the pipes in Aron Coleite's name. Should work fine if Aron's listed last or if we remove the pipes.--Hardvice (talk) 03:22, 19 December 2007 (EST)
- Oh no wait. That was the problem before. Now it's that it's only stripping off [[PAGENAME]] while the field is actually populated with [[PAGENAME]] and [[Some Other Guy]], so it's printing the remainder of the include. Hmm. Maybe the template wasn't such a bad deal after all.--Hardvice (talk) 03:25, 19 December 2007 (EST)
- Yup, it's DPLSearch. The old version works OK. Hmm. Not sure how we can get it to strip the whole field. You could use a second dpl statement to produce just the include and remove it, but that's an extra DPL for each section--at which point it would be just as efficient to use the phony template.--Hardvice (talk) 03:29, 19 December 2007 (EST)
- No, 4 times using DPLSearch would still be better than a lot more with the template. However, I've still a couple ideas to try.--MiamiVolts (talk) 03:36, 19 December 2007 (EST)
- It wouldn't be DPLSearch 4 times, though. You'd actually be calling dpl twice per section -- once to produce the output, and once to calculate what to remove. You could probably do it all with one DPLSearch.--Hardvice (talk) 03:42, 19 December 2007 (EST)
- Yeah, I noticed that the extra text is always before the * character, so my first idea is to pass through the string produced and nullify the text before each new line and the * character. Just trying to think up the correct use of pos and replace now; though now I think about it more it looks like there is no way to strip the different variations in one pass, and that it would take two dpl calls; good call.--MiamiVolts (talk) 03:53, 19 December 2007 (EST)
- It wouldn't be DPLSearch 4 times, though. You'd actually be calling dpl twice per section -- once to produce the output, and once to calculate what to remove. You could probably do it all with one DPLSearch.--Hardvice (talk) 03:42, 19 December 2007 (EST)
- No, 4 times using DPLSearch would still be better than a lot more with the template. However, I've still a couple ideas to try.--MiamiVolts (talk) 03:36, 19 December 2007 (EST)
- Yup, it's DPLSearch. The old version works OK. Hmm. Not sure how we can get it to strip the whole field. You could use a second dpl statement to produce just the include and remove it, but that's an extra DPL for each section--at which point it would be just as efficient to use the phony template.--Hardvice (talk) 03:29, 19 December 2007 (EST)
- I'm not sure what the reason is, but I'm noticing either formatting problems or actual content problems on every single page using this template. I'd much rather go back to using the second template. -- RyanGibsonStewart (talk) 06:33, 19 December 2007 (EST)
- Yeah, still trying to figure out a better DPLSearch using recursion, so you have seen some disparity while I tried to change the format. However, I haven't got it to parse yet, so I commented it out momentarily to get some rest. I try some more on it in a few hours.--MiamiVolts (talk) 11:02, 19 December 2007 (EST)
Recursion
I think we can add the extra text as part of the search using recursion in DPLSearch, something like the following:
{{#if: {{{result|}}}
| {{#if: {{{search|}}}
| {{#if: {{#len: {{#explode: {{{search}}}|\n|1}}}}}}
| {{DPLSearch|result={{#replace: {{{result}}} | {{#explode: {{{search}}}|\n|0}} |}}
|search={{#sub: {{{search}}} | {{#pos: {{{search}}}|\n}} }} }}
| {{#replace: {{{result}}} | {{#explode: {{{search}}}|\n|0}} |}}
| {{{result}}}
}}
}}
--MiamiVolts (talk) 05:43, 19 December 2007 (EST)