Activity Stream
48,167 MEMBERS
6994 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1.     
    #1
    Banned
    Website's:
    WarezRelease.org ThatHosting.co

    Default module

    Hi,

    ive made a news mod(workin great) 1 prob, it wont show me form in admin panel, heres my code:

    Code: 
        <?php
        /*BEGIN_INFO
        News mod by Chris2009.
        END_INFO*/
        if(!defined("WCDDL_GUTS"))
        exit;
    
        $modEnabled = true; //Change to false if don't use
        
        if($modEnabled) {  //start of $modenabled
    
        $add = array("news" => "News",);
    
        $core->admin_links = array_merge($core->admin_links, $add);
    
         function news() {
        
        global $core;
        
            if ($_POST['post']) 
        {
            //Switch the data to variables.
            $title = $_POST['title'];
        }
            $html .= '<form name="post-news" method="POST">
            </form>
            <hr />';
            return $html;
            }
        } //end 
        $core->attachHook("adminFunctions","news");
        ?>
    any help????????
    Chris2k Reviewed by Chris2k on . module Hi, ive made a news mod(workin great) 1 prob, it wont show me form in admin panel, heres my code: <?php /*BEGIN_INFO News mod by Chris2009. END_INFO*/ if(!defined("WCDDL_GUTS")) Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    PHP Code: 
    <?php
        
    /*BEGIN_INFO
        News mod by Chris2009.
        END_INFO*/
        
    if(!defined("WCDDL_GUTS"))
        exit;

        
    $modEnabled true//Change to false if don't use
        
    if($modEnabled) {  //start of $modenabled
        
    $add = array("news" => "News");
        
    $core->admin_links array_merge($core->admin_links$add);
        function 
    news() {
         global 
    $core;
            if (!isset(
    $_POST['add_news'])) 
        {
            
    //Switch the data to variables.
            
    $html '<table width="100%" border="0">
            <form name="post-news" action="" method="POST">
            <tr><td align="center" valign="top">Title: </td>
            <td align="left"><input name="title" type="text" size="50" /></td></tr>
            <tr><td align="center" valign="top">Post: </td>
            <td align="left"><textarea name="post" cols="95" rows="25"></textarea></td></tr>
            <tr><td align="center" valign="top" colspan="2"><input type="submit" value="Add News" name="add_news"/></td></tr>
            </form>
            </table>'
    ;
          }
          else
          {
          
    $title $_POST['title'];
          
    $post $_POST['post'];
          
    //BLA BLA insert Bla Bla
          
    $html "NEWS added";
          }
            echo 
    $html;
            }
         if(
    $_GET['go']=='news'$core->attachHook("adminFunctions","news");
        } 
    //end 
        
    ?>


  4.     
    #3
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    Thanks, works gr8..

    hmm can u tell mew where i went wrong?

  5.     
    #4
    Respected Developer
    Website's:
    wrzc.org
    Quote Originally Posted by Chris2009 View Post
    Thanks, works gr8..

    hmm can u tell me where i went wrong?
    The way modules work in WCDDL is you have to echo them instead of return them.
    Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic

    Huge list of Warez Sites and free Multiposter Templates

  6.     
    #5
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    but in the how to it says not to echo/print...

    also i tried echo ing it but when i did it shows on other mod pages..

  7.     
    #6
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    well i think i got it as tried my scrtipt, modified nd now working.

    now i need to no can i add my templateVar to my mod or wud i need to make an sepe rate wcddl file|?

    or casn i add da admin link to funcs.php????

  8.     
    #7
    Member
    if i understand you want to print the news.

    that can be done in same mod.

    PHP Code: 
    <?php
        
    /*BEGIN_INFO
        News mod by Chris2009.
        END_INFO*/
        
    if(!defined("WCDDL_GUTS"))
        exit;

        
    $modEnabled true//Change to false if don't use
        
    if($modEnabled) {  //start of $modenabled
        
    $add = array("news" => "News");
        
    $core->admin_links array_merge($core->admin_links$add);
        function 
    news() {
         global 
    $core;
            if (!isset(
    $_POST['add_news'])) 
        {
            
    //Switch the data to variables.
            
    $html '<table width="100%" border="0">
            <form name="post-news" action="" method="POST">
            <tr><td align="center" valign="top">Title: </td>
            <td align="left"><input name="title" type="text" size="50" /></td></tr>
            <tr><td align="center" valign="top">Post: </td>
            <td align="left"><textarea name="post" cols="95" rows="25"></textarea></td></tr>
            <tr><td align="center" valign="top" colspan="2"><input type="submit" value="Add News" name="add_news"/></td></tr>
            </form>
            </table><br />'
    ;
          }
          else
          {
          
    $title $_POST['title'];
          
    $post $_POST['post'];
          
    //BLA BLA insert Bla Bla
          
    $html "NEWS added";
          }
         echo 
    $html;
            }
         if(
    $_GET['go']=='news'$core->attachHook("adminFunctions","news");
         
         
    $getnews = ("SELECT * from news limit0,5");
         while(
    $gotnews mysql_fetch_array($getnews)) {
        
    $outputt $gotnews['title'].'<br />'.$gotnews['post'];
        }
        
    $core->setTemplateVar("MODNAME"$outputt); 
        
        } 
    //end mod enable
        
    ?>


  9.     
    #8
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    here is my code to display it:

    PHP Code: 
        //Now add to a templateVar.
            
    $getnews mysql_query("SELECT * FROM wcddl_news");
            
            while(
    $row mysql_fetch_assoc($getnews)) 
            {
                
    //get data
                
    $id $row['id'];
                
    $title $row['title'];
                
    $body $row['body'];
                
    $date $row['dat'];
                
            
    $nd "<div class='search-btn'>

            <font color='White'>
    $date</font>
            
            </div><br><br>"
    ;
            
            
    $nd nl2br ($title);
            
            
    $nd nl2br ($body);
                
            }
            
            
    $core->setTemplateVar("newsdisplay"$nd); 
    dunno y it isnt workin?

  10.     
    #9
    Member
    concatenate $nd

    $nd = "<div class='search-btn'>

    <font color='White'>
    $date</font>

    </div><br><br>"
    ;

    $nd .= nl2br ($title);

    $nd .= nl2br ($body);


  11.     
    #10
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    here is my full news mod:

    PHP Code: 
        <?php
        
    /*BEGIN_INFO
        News mod by Chris2009.
        END_INFO*/
        
    if(!defined("WCDDL_GUTS"))
        exit;

        
    $modEnabled true//Change to false if don't use
        
        
    if($modEnabled) {  //start of $modenabled
        
        
    $add = array("news" => "News");
        
        
    $core->admin_links array_merge($core->admin_links$add);
        
        function 
    news() {
        
        global 
    $core;
        
        if (!isset(
    $_POST['post'])) 
        {
            
    //Show table/form in ACP.
            
    $htmlnews "<form name='post-news' method='POST'>
            
            <p>News Title:</p>

            <input name='title' type='text' width='380' />

            <p>News Body:</p>
      
            <textarea name='body' cols='60' rows='10'></textarea>
      
            <br><input type='submit' name='post' value='Post this news..' />
            </form><hr /> <br>"
    ;
            }
            else {

                
    //Switch the data to variables.
                
    $title $_POST['title'];
                
    $body $_POST['body'];
                
    $date date('d m Y');
            
                
    //Insert to DB.
                
    $insert mysql_query("INSERT INTO wcddl_news VALUES ('','".mysql_real_escape_string($title)."','".mysql_real_escape_string($body)."','".mysql_real_escape_string($date)."')");
                
                
    $htmlnews "Your news has been posted.";
            }
            echo 
    $htmlnews//Always echo mods.
            
    //function end.
        
    if($_GET['go']=='news'$core->attachHook("adminFunctions","news"); //Add ACP link.
        
            //Now add to a templateVar.
            
    $getnews mysql_query("SELECT * FROM wcddl_news");
            
            while(
    $row mysql_fetch_assoc($getnews)) 
            {
                
    //get data
                
    $id $row['id'];
                
    $title $row['title'];
                
    $body $row['body'];
                
    $date $row['dat'];
                
            
    $nd .= "<div class='search-btn'>

            <font color='White'>
    $date</font>
            
            </div><br><br>"
    ;
            
            
    $nd .= nl2br ($title);
            
            
    $nd .= nl2br ($body);
                
            }
            
            
    $core->setTemplateVar("newsdisplay"$nd);  
        } 
    //end  of module.
    ?>
    as u can see the template at the bottom, nothing displays.

    any help? + this is how im calling it: <?=$core->templateVar("displaynews")?>

    this is right?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Wcddlv3 wcp module
    By darkfelon in forum Webmaster Resources
    Replies: 8
    Last Post: 31st Oct 2012, 01:57 AM
  2. [Selling] DLE imdbXpro v1.1 MODULE
    By scriptzm in forum Completed Transactions
    Replies: 0
    Last Post: 23rd Mar 2012, 06:21 PM
  3. [Joomla] looking for a module
    By Scientyst in forum Web Application/Script Support
    Replies: 0
    Last Post: 7th Dec 2011, 08:48 PM
  4. [WCDDL] making a module
    By Chris2k in forum Web Application/Script Support
    Replies: 1
    Last Post: 3rd Jun 2011, 05:54 PM
  5. Need help to download this module :(
    By Rapid4All in forum Web Application/Script Support
    Replies: 0
    Last Post: 14th Nov 2010, 03:37 PM

Tags for this Thread

BE SOCIAL