Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7833821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:54:40+00:00 2026-06-02T12:54:40+00:00

Can someone help a beginner? It says that Call to a member function set()

  • 0

Can someone help a beginner?
It says that Call to a member function set() on a non-object; I have been tinkering with this for 3 days and am unable to figure out what is causing this error.

here is the code

function torrent_download($item_details, $output_type = 'show_torrent')
    {
    $template->set('session', $session);
$torrent = $show->torrent_download($session->value('user_id'));
    {
    if ($session->value('is_seller'))
    {
        $show_tips = $db->count_rows('users', "WHERE user_id='" . $session->value('user_id') . "' AND notif_a=0");

        if ($show_tips)
        {
            $msg_member_tips = '<p class="errormessage">' . MSG_MEMBER_TIPS_A . '<br>' . MSG_MEMBER_TIPS_B . '</p>';
            $db->query("UPDATE " . DB_PREFIX . "users SET notif_a=1 WHERE user_id='" . $session->value('user_id') . "'");
        }
        $template->set('msg_member_tips', $msg_member_tips);
    }



if (isset($_REQUEST['form_download_proceed']))
    {
        $download_result = download_redirect($_REQUEST['winner_id'], $session->value('user_id'));

        if ($download_result['redirect'])
        {
            header('Location: ' . $download_result['url']);
        }

        $template->set('msg_changes_saved', '<p align="center">' . $download_result['display'] . '</p>');

    }
    }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:54:42+00:00Added an answer on June 2, 2026 at 12:54 pm

    I’m assuming you’re getting this error inside the torrent_download function?

    If so, that’s because $template is undefined. Perhaps you defined it in the global script, but functions don’t inherit that.

    You can prevent this issue by adding: global $template (and any other variable from the outside you need) to the start of your function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have another beginner's question that hopefully someone can help with. I'm trying to
Can someone help me find the problem? I have MainActivity, that when I go
Im a beginner to css, please can someone help me get this element to
can someone help with this? I need the following function to do this... $x
can someone help me with this? I have an AlertDialog box and its working
I'm a beginner in MATLAB and hope someone can help me with this problem.
Can someone help me with this very simple question. I'm very+++ beginner. This is
Can someone help me with this: This is a program to find all the
Can someone help me to find a solution on how to calculate a cubic
Can someone help me create an index/count button for a UITableView, like this one?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.