Mod Help needed

Started by Faevilangel, September 11, 2008, 06:48:37 PM

Previous topic - Next topic

Faevilangel

ok i have an idea for a pretty amazing mod which i have thought of from using one mod on here & seeing features on other pages.

It would be far easier to create a new mod but im stuck with the coding .....

i know php and i know html, css, javascript etc but new to SMF, still trying to find my way round ...... I would like to do most of the code myself but im finding it hard to find the functions i need in smf .....

would anyone who has created a mod or knows their way around smf, like to help me? i will do a lot of the coding....

i will obviously share the credit with the person & (if any) revenue comes from it, we shall share it .....

let me know thanks :-D
I am available for theme work, pm me for info

Charles Hill

What functions in particular are you looking for?

Faevilangel

1. to create a new category
2. create new boards

(the category be added in the installation & boards added by admin)

I am available for theme work, pm me for info

Charles Hill

Well I haven't used any of SMF's functions to create new categories yet, but i have used the createBoard and modifyBoard functions quite a bit.  They are located in Subs-Boards.php.  Have a look at those two functions.   Basically what they do is take the $boardOptions variable (which is an associative array) to create/modify a board.  Take a look at what options you can use (should be able to figure it out from looking at the functions).  I think a couple of the options are required... like the name for instance.

Faevilangel

thanks for help, the script will name the category .... which can't be changed but admin choose the boards ;)
I am available for theme work, pm me for info

Faevilangel

for my mod i want a drop list of threads made in the category

are the threads in each board stored in their own DB or will i need to do a search for them?
I am available for theme work, pm me for info

[SiNaN]

All topics in a category or in a board?

They are all stored in smf_topics table.
Former SMF Core Developer | My Mods | SimplePortal

Faevilangel

so too find a thread in a numerous boards but in one category i would do the following ??


$result = mysql_query("SELECT * FROM {db_prefix} where cat="cat_name"");


i knwo smf uses the {db_prefix} command but not sure on any more

how would i enable the results of the query to display in a drop down box ?

i can put in table :|
I am available for theme work, pm me for info

[SiNaN]

$request = db_query("
SELECT t.ID_TOPIC, m.subject
FROM {$db_prefix}topics as t
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = t.ID_FIRST_MSG)
LEFT JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
WHERE ID_CAT = 'CAT_ID'", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
{

$return[] = array(
'id' => $row['ID_TOPIC'],
'name' => $row['subject'],
);
}
mysql_free_result($request);

echo '
<select id="contest" name="contest">';
foreach($return as $topic)
echo '
<option value="', $topic['id'], '">', $topic['name'], '</option>';
echo '
</select>';


Change 'CAT_ID' as the category ID.
Former SMF Core Developer | My Mods | SimplePortal

Advertisement: