Advertisement:

Author Topic: Mod Help  (Read 15545 times)

Offline John Slater

  • Jr. Member
  • **
  • Posts: 150
    • Proper Doh Members
Mod Help
« on: June 05, 2005, 01:27:51 PM »
Hi i posted this a few minutes ago but in the wrong place, hopefully someone will delete the old one.

__________________________________________
ok here is the code i wrote using the template SMF has. I want to add some code to a file and as far as i know it should work, but it doesnt so something is wrong. I have uploaded it via the package manager and the file says fail when i try to install it. Please inform.

Its only a test mod but when i have it working i want to develop it more.

The code is below.

Code: [Select]
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This is an example modification file for SMF packages.

ATTENTION: If you are trying to install this manually, you should try
the package manager.  If it will not work for you, please take a look
at the following for information on this format:
http://mods.simplemachines.org/docs/manual-install.php

================================================================================

Modification files can be used to modify files so that they do what
your package needs them to do to work properly.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<!-- This information needs to be the same as that in the package-info.xml. -->
<id>username:thesimpsonsjohn</id>
<version>1.1</version>

<!-- Edit a specific file.. -->
<file name="$themedir/Profile.template.php">
<!-- A seach operation, with search rules and code to modify the file with. -->
<operation>
<!-- Search for this text before the code we add.  You can also search for after, and the end of the file. -->
<search position="before"><![CDATA[
$context['member']['website']['url'], '" /></td>
]]></search>
<!-- Add this text when we find it.  Note that it's on it's own line on purpose, and the CDATA keeps things clean. -->
<add><![CDATA[
</tr><tr>
<td><b>Real name: </b></td>
<td><input type="text" name="default_options[profile_real_name]" size="50" value="', @$context['member']['options']['profile_real_name'], '" /></td>
]]></add>
</operation>


</file>
</modification>

This is only step one, step two was deleted until i get step one working.

Hope you great guys can help.

rudoka

  • Guest
Re: Mod Help
« Reply #1 on: June 05, 2005, 11:16:26 PM »
Code: [Select]
<search position="before"><![CDATA[
<td><input type="text" name="websiteUrl" size="50" value="', $context['member']['website']['url'], '" /></td>
]]></search>

This works for me.
Though it just changes the Profile.template.php. In the forum the real name is still not visible. If that is what you wanted.

Rudolf
« Last Edit: June 05, 2005, 11:20:26 PM by rudoka »

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Mod Help
« Reply #2 on: June 06, 2005, 04:17:07 AM »
This:

<![CDATA[
$context['member']['website']['url'], '" /></td>


Means:

"\n\$context['member']['website']['url'], '\" /></td>"

What you want is:

<![CDATA[$context['member']['website']['url'], '" /></td>

Without the \n in the front.

-[Unknown]

Offline John Slater

  • Jr. Member
  • **
  • Posts: 150
    • Proper Doh Members
Re: Mod Help
« Reply #3 on: June 06, 2005, 05:02:31 AM »
sorry to be a pain, not quite sure what you mean. :-( that code you posted is on my mod as far as i can see, what am i doing wrong? and where?

sorry :-)

rudoka

  • Guest
Re: Mod Help
« Reply #4 on: June 06, 2005, 10:32:04 AM »
It means that or you use what I said or you put what [Unknown] said.

Something like this:
Code: [Select]
<search position="before"><![CDATA[$context['member']['website']['url'], '" /></td>]]>
</search>

Mine works because I practically search for the whole line. Having the line break caracter both at the beginning and the end.
The CDATA must be exactly as in the file, spaces, tabs, line break and other white space characters included. Yours is not.  ;)
Thanks [Unknown] for pointing that \n out. I had no idea why it wouldn't work.

Rudolf

Offline John Slater

  • Jr. Member
  • **
  • Posts: 150
    • Proper Doh Members
Re: Mod Help
« Reply #5 on: June 06, 2005, 11:15:26 AM »
ok i will try it now. :-) thanks.

Offline John Slater

  • Jr. Member
  • **
  • Posts: 150
    • Proper Doh Members
Re: Mod Help
« Reply #6 on: June 06, 2005, 11:53:18 AM »
Ok, using the SDK thing, how do i make the script add code before (the line above) a certain point?

rudoka

  • Guest
Re: Mod Help
« Reply #7 on: June 06, 2005, 02:10:18 PM »
Code: [Select]
<search position="after"><![CDATA[
<td><input type="text" name="websiteUrl" size="50" value="', $context['member']['website']['url'], '" /></td>
]]></search>
<add><![CDATA[
<tr>
<td><b>Real name: </b></td>
<td><input type="text" name="default_options[profile_real_name]" size="50" value="', @$context['member']['options']['profile_real_name'], '" /></td></tr>
]]></add>


You will need to include the whole line if you want to insert it before. If you use only $context['member']['website']['url'], '" /></td> it will insert before that code, meaning in themiddle of the line there. Which is not good, right?  ;)

OR you can do:
Code: [Select]
<search position="replace"><![CDATA[
<td><input type="text" name="websiteUrl" size="50" value="', $context['member']['website']['url'], '" /></td>
]]></search>

<add><![CDATA[
<tr>
<td><b>Real name: </b></td>
<td><input type="text" name="default_options[profile_real_name]" size="50" value="', @$context['member']['options']['profile_real_name'], '" /></td></tr>
<td><input type="text" name="websiteUrl" size="50" value="', $context['member']['website']['url'], '" /></td>
]]></add>

But I'm just guessing here, since I don't know what you really want to do.

Rudolf

Offline John Slater

  • Jr. Member
  • **
  • Posts: 150
    • Proper Doh Members
Re: Mod Help
« Reply #8 on: June 06, 2005, 03:15:02 PM »
Thanks mate, i thought of putting after but didnt know whether it would work. But i got the mod to work, i have submitted it.

rudoka

  • Guest
Re: Mod Help
« Reply #9 on: June 06, 2005, 03:54:13 PM »
Submitted where?  ???

Online Gazmanafc

  • Sorceress's Knight
  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,833
  • Gender: Male
  • So this is the luck of the draw...
    • Gazmanafc on Facebook
    • garygadsdon on LinkedIn
    • @Gazmanafc on Twitter
    • The Bongo Comics Fan Forum
Re: Mod Help
« Reply #10 on: June 06, 2005, 03:56:14 PM »
The Mod site. My guess is that its waiting to be approved.
Gary M. Gadsdon
Do NOT PM me unless I say so

War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

rudoka

  • Guest
Re: Mod Help
« Reply #11 on: June 06, 2005, 04:04:57 PM »
AHA!  :o
Well, I just finished my mod too. Two days ago.
   I was wondering how could I have it listed somewhere else then my own package server.
   But then I didn't saw much interest from people here, so I just dumped the idea. There is a mod already for what I wrote, and I don't care much anymore to have mine listed, anyway.

Hm, should I submit or should I go?  :-\
Rudolf

Online Gazmanafc

  • Sorceress's Knight
  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,833
  • Gender: Male
  • So this is the luck of the draw...
    • Gazmanafc on Facebook
    • garygadsdon on LinkedIn
    • @Gazmanafc on Twitter
    • The Bongo Comics Fan Forum
Re: Mod Help
« Reply #12 on: June 07, 2005, 02:33:08 AM »
You can submit your mod here it'd be great if you could share your mod with the community, I feel.
Gary M. Gadsdon
Do NOT PM me unless I say so

War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Offline John Slater

  • Jr. Member
  • **
  • Posts: 150
    • Proper Doh Members
Re: Mod Help
« Reply #13 on: June 07, 2005, 04:52:27 AM »
my mod is submitted. When its approved i will make my Skype! mod.

Offline John Slater

  • Jr. Member
  • **
  • Posts: 150
    • Proper Doh Members
Re: Mod Help
« Reply #14 on: June 07, 2005, 11:42:30 AM »
How long until my mod is accepted?  :)

Offline dtm.exe

  • SMF Hero
  • ******
  • Posts: 5,465
Re: Mod Help
« Reply #15 on: June 07, 2005, 11:48:58 AM »
How long until my mod is accepted?  :)

When a Mod Developer dubs it safe for SMF, then it will be released.

-Dan The Man

rudoka

  • Guest
Re: Mod Help
« Reply #16 on: June 07, 2005, 12:02:18 PM »
How long until my mod is accepted?  :)

When a Mod Developer dubs it safe for SMF, then it will be released.

-Dan The Man

Maybe that's why my instinct says to don't bother submitting mine. lol

Online Gazmanafc

  • Sorceress's Knight
  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,833
  • Gender: Male
  • So this is the luck of the draw...
    • Gazmanafc on Facebook
    • garygadsdon on LinkedIn
    • @Gazmanafc on Twitter
    • The Bongo Comics Fan Forum
Re: Mod Help
« Reply #17 on: June 07, 2005, 12:03:09 PM »
It varies, mine took a couple of days.
Gary M. Gadsdon
Do NOT PM me unless I say so

War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Offline dtm.exe

  • SMF Hero
  • ******
  • Posts: 5,465
Re: Mod Help
« Reply #18 on: June 07, 2005, 12:26:12 PM »
It varies, mine took a couple of days.

As did my mod.

-Dan The Man

Offline John Slater

  • Jr. Member
  • **
  • Posts: 150
    • Proper Doh Members
Re: Mod Help
« Reply #19 on: June 08, 2005, 08:33:37 AM »
My first mod took 1 day, my last 2 havent been varified yet.