Results 1 to 10 of 14
-
17th Jun 2011, 12:24 AM #1OPBannedWebsite's:
WarezRelease.org ThatHosting.comodule
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"); ?>
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
-
18th Jun 2011, 02:25 AM #2MemberPHP 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
?>
-
18th Jun 2011, 07:54 PM #3OPBannedWebsite's:
WarezRelease.org ThatHosting.coThanks, works gr8..
hmm can u tell mew where i went wrong?
-
18th Jun 2011, 07:59 PM #4Respected DeveloperWebsite's:
wrzc.orgTutorial How to SEO your Warez Site a guide to help you increase your organic traffic
Huge list of Warez Sites and free Multiposter Templates
-
18th Jun 2011, 08:05 PM #5OPBannedWebsite's:
WarezRelease.org ThatHosting.cobut 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..
-
18th Jun 2011, 08:29 PM #6OPBannedWebsite's:
WarezRelease.org ThatHosting.cowell 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????
-
18th Jun 2011, 10:02 PM #7Member
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
?>
-
18th Jun 2011, 11:44 PM #8OPBannedWebsite's:
WarezRelease.org ThatHosting.cohere 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);
-
19th Jun 2011, 11:53 AM #9Member
-
21st Jun 2011, 12:31 AM #10OPBannedWebsite's:
WarezRelease.org ThatHosting.cohere 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.
?>
any help? + this is how im calling it: <?=$core->templateVar("displaynews")?>
this is right?
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Wcddlv3 wcp module
By darkfelon in forum Webmaster ResourcesReplies: 8Last Post: 31st Oct 2012, 01:57 AM -
[Selling] DLE imdbXpro v1.1 MODULE
By scriptzm in forum Completed TransactionsReplies: 0Last Post: 23rd Mar 2012, 06:21 PM -
[Joomla] looking for a module
By Scientyst in forum Web Application/Script SupportReplies: 0Last Post: 7th Dec 2011, 08:48 PM -
[WCDDL] making a module
By Chris2k in forum Web Application/Script SupportReplies: 1Last Post: 3rd Jun 2011, 05:54 PM -
Need help to download this module :(
By Rapid4All in forum Web Application/Script SupportReplies: 0Last Post: 14th Nov 2010, 03:37 PM
themaManager - edit and manage...
Version 4.04 released. Open older version (or...