Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Virgin_Steel
Worker
Worker



Joined: Sep 30, 2004
Posts: 108
Location: Sf

PostPosted: Fri Apr 15, 2005 6:45 pm Reply with quote

I need very simple module for my products.Don't need categories or something special.
All i want is to show my products like that:
Image
...................
(read more..) to call simple extended info text page!
Could someone to help me??
Thank!
 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Sat Apr 16, 2005 7:35 am Reply with quote

If your not using it for something else you could use the Content module or something. Seriously I'd consider using one of the Cart modules since there would be the added benefit of some pre-designed blocks and so on...

Otherwise even for a simple module from scratch your probably looking at around $200.00-$300.00 give or take, money better spent for advertising or something IMO.

But anyway no I don't know of a simple knock off of the news which is basically what you have described.

_________________
[b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 
View user's profile Send private message
Virgin_Steel







PostPosted: Sat Apr 16, 2005 9:29 am Reply with quote

the problem is that, i'm using Content Module already, and i put Title(History) on it...so no matter what i add to it...it's shown with the Title 'History'.If i can configure it to show Title on only one Categoriq or i don't know.Or i'll just copy the Content module, and rewrite the code and the tables like $pid1,$content1 etc etc...
I would like to make this moduke on my own...it need only 3 sql values...$title,$img,$extendedtext ...nothing more.But i'm at the begining of my php-sql knowledge..so i can make admin form to inject the things in the table,but i cant call them (sql fretchrow...etc etc).I'll try to find some basic Tutorial...

BTW.How can i make in index.php in a module to show extended contents!
I mean...diffirent pages inside the module?
 
Virgin_Steel







PostPosted: Sun Apr 17, 2005 4:46 pm Reply with quote

ok i got a little progress with my module:))
Now only left to make admin panel and multilingual , because my site is runnin` on 3 languages.
I added $alanuage value to the table nuke_products , so in the admin i'll be able to input the language there.Could someone help me to show only content with
$currentlanguage = $alanguage ??? Same like blocks, news module etc.... got this option to choose in which langage to be shown.
Here is the code:
Quote:

<?php

/***********************************************************/
/* PHP-NUKE: Products module! Virgin_Steel */
/* =========================== */
/* */
/*****************************************************/

if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");

}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);

// ######################
// ## Display All Products ##
// ######################
function DisPro(){
global $prefix, $db, $module_name, $nukeurl, $dbi, $themecurrentlang, $multilingual, $currentlang;
if ($multilingual == 1) {
$querylang = "AND (alanguage='$currentlang' OR alanguage='')";
} else {
$querylang = "";
}
include("header.php");
$result = $db->sql_query("SELECT * FROM ".$prefix."_products ORDER BY sid");
$num = $db->sql_numrows($result);
if($num) {
echo "<center><img src=\"themes/Ace-Orange/language/lang_$themecurrentlang/modules/prod.gif\" border=\"0\"></center>";
while ($row = $db->sql_fetchrow($result)) {
$sid = "$row[sid]";
$title = "$row[title]";
$bodytext = "$row[bodytext]";
$hometext = "$row[hometext]";
$img = "$row[img]";
$alanguage = "$row[alanguage]";
echo"<table border='1' cellpadding='2' cellspacing='5' width='100%' class='row1'><tr>";
echo" <td class='row1' width='230' align=\"center\"><a href=\"images/products/$img\" target=\"_blank\"><img src=\"images/products/$img\" alt=\"$title\" border=\"0\" align=\"center\"></a></td><td><b>$title</b><br><br>$hometext<br><a href=\"modules.php?name=Prob&func=readm&sid=$sid\">("._RMORE.")</a></td></tr>";
}
echo "</table>\n";
} else {
echo "<table width=\"100%\"><tr><td>";
echo "<center><img src=\"images/products/$img\" alt=\"$img\"></center></td><td class='row1'><b>$title</b><br><br>$hometext<br>";
echo "</td></tr></table>";
}
include("footer.php");
}
// ################
// ## Display Product ##
// ################
function readm($sid){
include("header.php");
global $prefix, $db, $module_name, $sid, $nukeurl, $dbi, $themecurrentlang;
$result = $db->sql_query("SELECT * FROM ".$prefix."_products WHERE sid='$sid'");
$num = $db->sql_numrows($result);
if($num) {
echo "<center><img src=\"themes/Ace-Orange/language/lang_$themecurrentlang/modules/prod.gif\" border=\"0\"></center>";
while ($row2 = $db->sql_fetchrow($result)) {
$sid = "$row2[sid]";
$title = "$row2[title]";
$bodytext = "$row2[bodytext]";
$hometext = "$row2[hometext]";
$img = "$row2[img]";
}
echo"<img alt=\"$title\" src=\"images/products/$img\" border=\"0\" align=\"left\"><center><b>$title</b><br><br>$bodytext<br><br><br>"._GOBACK."</center>";
} else {
echo "<table width=\"100%\"><tr><td>";
echo "<center><img src=\"images/products/$img\" alt=\"$img\"></center></td><td class='row1'><b>$title</b><br><br>$hometext<br>";
echo "</td></tr></table>";
}
include("footer.php");
}

switch($func) {

default:
DisPro();
break;

case "readm":
readm($sid);
break;
}
?>


Pls.Help!Thank U!
 
Virgin_Steel







PostPosted: Mon Apr 18, 2005 7:47 am Reply with quote

HM looks like no one wants to help me...
I just made it, with all night no sleeping.
Now need help with the admin file.I made it but when i click on post, nothin`...blank page.Just want to insert SQL Values to the table.So that's the code.I don't see any mistakes, but if you do, tell me pls.It's just 2 functions:
Quote:

<?php

/************************************************************************/
/* Products */
/************************************************************************/

if ( !defined('ADMIN_FILE') )
{
die("Illegal File Access");
}

global $prefix, $db, $admin_file;
if (!stristr($_SERVER['SCRIPT_NAME'], "".$admin_file.".php")) {
die ("Access Denied");
}

$aid = substr("$aid", 0,25);
$row = $db->sql_fetchrow($db->sql_query("SELECT title, admins FROM ".$prefix."_modules WHERE title='Encyclopedia'"));
$row2 = $db->sql_fetchrow($db->sql_query("SELECT name, radminsuper FROM ".$prefix."_authors WHERE aid='$aid'"));
$admins = explode(",", $row['admins']);
$auth_user = 0;
for ($i=0; $i < sizeof($admins); $i++) {
if ($row2['name'] == "$admins[$i]" AND $row['admins'] != "") {
$auth_user = 1;
}
}

if ($row2['radminsuper'] == 1 || $auth_user == 1) {
/*********************************************************/
/* Story/News Functions */
/*********************************************************/

function addprod($sid) {
global $prefix, $db, $language, $multilingual, $admin_file;
include ('header.php');
OpenTable();
echo "<center><font class=\"title\"><b>"._PRODADMIN."</b></font></center>";
CloseTable();
echo "<br>";
OpenTable();
echo "<center><font class=\"option\"><b>"._ADDPROD."</b></font></center><br><br>"
."<form action=\"".$admin_file.".php\" method=\"post\">"
."<b>"._TITLE."</b><br>"
."<input type=\"text\" name=\"title\" size=\"50\"><br><br>"
."<b>"._IMG."</b><br>"
."<input type=\"text\" name=\"img\" size=\"50\"><br><br>"
."<b>"._IMG2."</b><br>"
."<input type=\"text\" name=\"img2\" size=\"50\"><br><br>"
."<br>";
if ($multilingual == 1) {
echo "<br><b>"._LANGUAGE.": </b>"
."<select name=\"alanguage\">";
$handle=opendir('language');
while ($file = readdir($handle)) {
if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
$langFound = $matches[1];
$languageslist .= "$langFound ";
}
}
closedir($handle);
$languageslist = explode(" ", $languageslist);
sort($languageslist);
for ($i=0; $i < sizeof($languageslist); $i++) {
if($languageslist[$i]!="") {
echo "<option value=\"$languageslist[$i]\" ";
if($languageslist[$i]==$language) echo "selected";
echo ">".ucfirst($languageslist[$i])."</option>\n";
}
}
echo "<option value=\"\">"._ALL."</option></select>";
} else {
echo "<input type=\"hidden\" name=\"alanguage\" value=\"$language\">";
}
echo "<input type=\"hidden\" name=\"sid\" value=\"5\">";
echo "<br><br><b>"._STORYTEXT."</b><br>"
."<textarea wrap=\"virtual\" cols=\"50\" rows=\"12\" name=\"hometext\"></textarea><br><br>"
."<b>"._EXTENDEDTEXT."</b><br>"
."<textarea wrap=\"virtual\" cols=\"50\" rows=\"12\" name=\"bodytext\"></textarea><br>"
."<select name=\"op\">"
."<option value=\"postprod\">"._POSTSTORY."</option>"
."</select>"
."<input type=\"submit\" value=\""._OK."\">";
CloseTable();
echo "<br>";
echo "</form>";
include ('footer.php');
}

function postprod($sid, $title, $hometext, $bodytext, $img, $img2, $alanguage) {
global $prefix, $db, $admin_file;
$title = stripslashes(FixQuotes($title));
$hometext = stripslashes(FixQuotes($hometext));
$bodytext = stripslashes(FixQuotes($bodytext));
$db->sql_query("insert into ".$prefix."_products values(NULL, '$sid', '$title', '$hometext', '$bodytext', '$alanguage', '$img', '$img2')");
Header("Location: ".$admin_file.".php?op=adminMain");
}

switch($op) {

case "addprod":
addprod($sid);
break;

case "postprod":
postprod($sid, $title, $hometext, $bodytext, $img, $img2, $alanguage);
break;
}

} else {
include("header.php");
GraphicAdmin();
OpenTable();
echo "<center><b>"._ERROR."</b><br><br>You do not have administration permission for module \"$module_name\"</center>";
CloseTable();
include("footer.php");
}

?>
 
Virgin_Steel







PostPosted: Mon Apr 18, 2005 8:23 am Reply with quote

ok i fixed everything Smile)
i forgot to put case "postprod" in case.php...!Now everything works fine!
Thanks everybody who helped me! Smile)))
 
Michael-CGC
Hangin' Around



Joined: Apr 07, 2005
Posts: 29

PostPosted: Mon Apr 18, 2005 10:16 am Reply with quote

Hey Virgin_Steel

Your module sounds just something that I need :O) Could I have it? :O)

regards,
Michael
 
View user's profile Send private message
Virgin_Steel







PostPosted: Mon Apr 18, 2005 1:11 pm Reply with quote

Michael-CGC, i'll make edit and delete function, maybe and upload for images...and i will post link for download here!
 
Virgin_Steel







PostPosted: Mon Apr 18, 2005 5:47 pm Reply with quote

ok Product module v1.0 is OUT!Smile)
EDIT:I Found some bugs...i'll make it just today!
Enjoy.And dont kill me with stones that's my second module:)


Last edited by Virgin_Steel on Tue Apr 19, 2005 6:23 am; edited 1 time in total 
Michael-CGC







PostPosted: Tue Apr 19, 2005 2:39 am Reply with quote

Virgin_Steel wrote:
ok Product module v1.0 is OUT!Smile)
You can download it from here
Enjoy.And dont kill me with stones that's my second module:)


Mate, the link doesn't work :O)
 
Virgin_Steel







PostPosted: Tue Apr 19, 2005 4:08 am Reply with quote

Michael-CGC, i dunno what's happening with my host.server is down for 6 hours...I could send the module you via mail.
 
Michael-CGC







PostPosted: Tue Apr 19, 2005 4:16 am Reply with quote

Virgin_Steel wrote:
Michael-CGC, i dunno what's happening with my host.server is down for 6 hours...I could send the module you via mail.


Weird! :O/

Plz send it to [ Only registered users can see links on this board! Get registered or login! ].

Thx mate :O)
 
Virgin_Steel







PostPosted: Tue Apr 19, 2005 4:30 am Reply with quote

sent

Next feature will be Uploading of the images..
Is there anybody who can quick help me about it?
 
Mesum
Useless



Joined: Aug 23, 2002
Posts: 213
Location: Chicago

PostPosted: Tue Apr 19, 2005 5:11 am Reply with quote

I am not able to download this file as well.
mesum(@)chicagobase(.)com

_________________
Only FREE Dating Site for Desis 
View user's profile Send private message Visit poster's website
Virgin_Steel







PostPosted: Tue Apr 19, 2005 10:03 am Reply with quote

HERE IS THE MODULE!
Please read Install.txt for versions diffirent from Platinium!
I tested it on Nuke PLatinium, 7.1, 7.0, 7.2 and works without problems!
 
Michael-CGC







PostPosted: Wed Apr 20, 2005 2:05 am Reply with quote

Virgin_Steel wrote:
HERE IS THE MODULE!
Please read Install.txt for versions diffirent from Platinium!
I tested it on Nuke PLatinium, 7.1, 7.0, 7.2 and works without problems!


Cool mate. I actually use phpnuke platinium :O)

Are you good at making modules? :O)
 
Virgin_Steel







PostPosted: Wed Apr 20, 2005 4:19 am Reply with quote

Virgin_Steel wrote:
ok Product module v1.0 is OUT!Smile)
EDIT:I Found some bugs...i'll make it just today!
Enjoy.And dont kill me with stones that's my second module:)

Actually i have modified all the modules on my Nuke site.And have made and modify many blocks too.But that's my first module i build all alone.I'm just learning.
After few hours i'll post link for the module with the upload function.
 
Michael-CGC







PostPosted: Wed Apr 20, 2005 4:22 am Reply with quote

Virgin_Steel wrote:
Virgin_Steel wrote:
ok Product module v1.0 is OUT!Smile)
EDIT:I Found some bugs...i'll make it just today!
Enjoy.And dont kill me with stones that's my second module:)

Actually i have modified all the modules on my Nuke site.And have made and modify many blocks too.But that's my first module i build all alone.I'm just learning.
After few hours i'll post link for the module with the upload function.


Is the answer "no"? lol :O)
 
Virgin_Steel







PostPosted: Wed Apr 20, 2005 4:34 am Reply with quote

The Answer is "i'm learning and trying hard to be good" Smile)


For those who have downloaded the module there is one little bug:
change this line - for Older Nuke versions in admin/modules/products.php
Line 104:
from
Code:
   $db->sql_query("insert into ".$prefix."_products values (NULL, '$title', '$hometext', '$bodytext', '$img2', '$img', '$alanguage')");

to
Code:
   $db->sql_query("insert into ".$prefix."_products values (NULL, '$title', '$hometext', '$bodytext', '$img', '$img2', '$alanguage')");


For newer versions of Nuke
in modules/Porducts/admin/index.php Line 123
from
Code:
   $db->sql_query("insert into ".$prefix."_products values (NULL, '$title', '$hometext', '$bodytext', '$img2', '$img', '$alanguage')");

to
Code:
   $db->sql_query("insert into ".$prefix."_products values (NULL, '$title', '$hometext', '$bodytext', '$img', '$img2', '$alanguage')");

Sorry!
 
Virgin_Steel







PostPosted: Wed Apr 20, 2005 10:31 am Reply with quote

OK Now out is fixed version with Upload function.
Easy uploading of files with only two clicks:)
HERE Product module V1.1Smile)
Hope you'll like it!

EDIT: I just added select function.Now when you have uploaded an image,you'll just need to select it , not like before, to write the filename.
EDIT2: I just added a cool java effect.When you are selecting the images,they are showed beside, so you preview them before post them.It's the same like the avatar in Your_Account!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©