Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Multimedia Studio Mods

Asked Modified Viewed 3,010 times
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
asked
Senior Member

I know that for a lot of you this is probably basic stuff. I've done a lot of web searching but can't find a way to do what I need to do in my script. I have a form for creating sub-categories. The new sub-category falls under one of the main categories. I have added a db field in categories to hold the 'name' of the main category for final output sorting of sub-categories. I'm trying to use a hidden input based on the selected category_id(name). Here is my select statement:

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]echo "<td><select class='textbox' name='mus_cat_id'>";
$result = dbquery("SELECT mus_cat_id, mus_cat_title FROM ".DB_MM_MUSIC_CATS." WHERE mus_parentid=0 ORDER BY mus_cat_title"wink;
while(list($mus_cat_id,$mus_cat_title2) = dbarraynum($result)) {
echo "<option id='mus_cat_title2' value='".$mus_cat_id."'>$mus_cat_title2</option>";
}
echo "</select>\n";[/syntaxhighlighter]

I added the id='mus_cat_title2' to the option line to try to extract the actual cat title rather than the cat_id for the hidden input field which is:


[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
echo "<td colspan='2'>
<input type='hidden' name='mus_parent_title' value='".$mus_cat_title2."' /></td>\n";[/syntaxhighlighter]

Of course this doesn't work; it won't pick up the mus_cat_title as mus_parent_title for insertion in the db table. This may be a little vague and I apologize; if anyone can help me I sure would appreciate it.
Edited by Grimloch on 15-12-2010 15:07,
0 replies

12 posts

R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Quote



BTW: can't believe you guys haven't added either 'php code' OR simply 'code' BBCodes to the forum posting.
cool


[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: articles.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."articles.php";?>[/syntaxhighlighter]

And what is this?
0 replies
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
answered
Senior Member

Oh OK... I see; it's under 'Code Highlighter' duhhhhh....!
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

For what do you need this? Is it for a Download-Project? The News-Script is not the right thing for it?
0 replies
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
answered
Senior Member

This is one of the admin scripts in my popular 'Multimedia Studio Panel' infusion. Ever since it was accepted as an official infusion on the old mods site, I have never ceased to try to make it better. It is now totally compatible with Fusion 7.01.02. Essentially it's a combination of the standard photo gallery and my Classified Ads infusion. I just need to be able (using the new db field), to be able to sort the sub-categiries properly.

I have to leave for work now and have no more time but can explain in much greater detail later if you or anyone is interested in helping me.

:D
0 replies
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
answered
Senior Member

Nevermind... I figured out how to do what I needed a different way.
;)
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Could you please tell us, how you did it. I'm curious and I'm sure that I'm not alone...B)
0 replies
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
answered
Senior Member

Sure ! OK, I needed to be able to record the 'main_cat_title' within the 'sub-cat- record for sorting later on. I didn't need the hidden input field at all cause it won't work that way w/o lots of javascript manipulation. So I simply did another query at POST time to extract the 'main_cat_title' from the db based on the posted 'main_cat_id' from the select structure thusly:

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
$result1 = dbquery("SELECT mus_cat_title FROM ".DB_MM_MUSIC_CATS." WHERE mus_cat_id='".$_POST['mus_cat_id']."' AND mus_parentid='0'"wink;
$data = dbarray($result1);
$mus_parent_title = $data['mus_cat_title'];

$result = dbquery("INSERT INTO ".DB_MM_MUSIC_CATS." (mus_cat_id, mus_cat_title, mus_cat_desc, mus_cat_user, mus_cat_img, mus_cat_access, mus_parentid, mus_parent_title, mus_cat_datestamp, mus_cat_status) VALUES ('', '$mus_cat_title', '$mus_cat_desc', '".$userdata['user_id']."', '$mus_cat_img', '$mus_cat_access', '$mus_cat_id', '$mus_parent_title', '".time()."', '$mus_cat_status'wink"wink;
[/syntaxhighlighter]

Works great!! Then my ORDER BY sort function became:

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
$result = dbquery("SELECT mus_cat_id, mus_cat_title, mus_cat_desc, mus_cat_img, mus_parentid, mus_parent_title, mus_cat_status FROM ".DB_MM_MUSIC_CATS."
WHERE mus_cat_status='1' AND mus_parentid>'0' ORDER BY mus_parent_title, mus_cat_title ASC LIMIT $subcatz"wink;
[/syntaxhighlighter]

If you'd like to see the whole thing in action just visit my mod-support site(need to register)

www.whisperwillow.com/
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Thanks. I registered...
0 replies
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
answered
Senior Member

Hey guy; you registered and I approved your account. But you have never logged in to check it out!

B)
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Quote

Grimloch wrote:
Hey guy; you registered and I approved your account. But you have never logged in to check it out!

B)


It always says: "Invalid Username..."
0 replies
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
answered
Senior Member

Hmmmmmmm....... thats weird! Anyway I just changed your login password so I could try it myself and I logged in as you with no problem at all. I'll PM you the password so you can login and change it back.
0 replies
R
Rolf Mayer
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

Ok, now it works. Thanks
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 12 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

G
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
R
R
Ex
  • Senior Member, joined since
  • Contributed 391 posts on the community forums.
  • Started 7 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet