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?

Add non-infusion site link at infuse time

Asked Modified Viewed 1,204 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 need some help. I have an infusion where I need to create a non-infusion site link within the infusion.php file using the ALTER TABLE construct. For some reason I can't get it to work. Here's what I am trying:
if(isset($_POST['infuse'])){ 
    dbquery("    ALTER TABLE ".DB_SITE_LINKS." 
                ADD '".$locale['up104']."', 'users_upload.php', '101', '2', '0', '0';
            ");
}

The reason it can't be added as a link would normally be in the infusion, is that the file lives in the root directory but is part of the infusions functioning.
Edited by Grimloch on 06-09-2017 22:40,
0 replies

2 posts

C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Add and Reduction is this:

$inf_insertdbrow[] = DB_SITE_LINKS." (link_name, link_url, link_visibility, link_position, link_window, link_order, link_status, link_language) VALUES('".$locale['up104']."', 'users_upload.php', '0', '2', '0', '2', '1', '".LANGUAGE."')";

$inf_deldbrow[] = DB_SITE_LINKS." WHERE link_url='users_upload.php'";


Alter Table is used if you need to upgrade and change table structure.
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

Duhhh... I feel like such a dummy ! Thanks Chan I appreciate it. This is 7.02.07 I'm talking about so I'll just modify that to work correctly.

Merged on Sep 07 2017 at 11:18:16:
I have modified the code and need to know if this is a valid scenario. Link order is a problem at infuse time so I took this code from 'administration/infusions.php' - I think this will work but I need confirmation please.
$link_order = dbresult(dbquery("SELECT MAX(link_order) FROM ".DB_SITE_LINKS),0) + 1;
$inf_insertdbrow[1] = DB_SITE_LINKS." (link_name, link_url, link_visibility, link_position, link_window, link_order) VALUES('".$locale['up104']."', 'users_upload.php', '101', '2', '0', '$link_order')";


Merged on Sep 10 2017 at 17:11:28:
This thread can be closed as I found a better way to accomplish what I needed to do.
Edited by Grimloch on 10-09-2017 22:11,
0 replies

Labels

None yet

Statistics

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

2 participants

C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
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

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet