onokazu
onoka****@users*****
2005年 6月 11日 (土) 11:32:57 JST
Index: xoops2jp/html/modules/xoopspartners/index.php diff -u xoops2jp/html/modules/xoopspartners/index.php:1.2 xoops2jp/html/modules/xoopspartners/index.php:1.3 --- xoops2jp/html/modules/xoopspartners/index.php:1.2 Fri Mar 18 21:52:49 2005 +++ xoops2jp/html/modules/xoopspartners/index.php Sat Jun 11 11:32:57 2005 @@ -1,5 +1,5 @@ <?php -// $Id: index.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $ +// $Id: index.php,v 1.3 2005/06/11 02:32:57 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -33,71 +33,71 @@ include XOOPS_ROOT_PATH."/header.php"; $part = new PartnerSystem(); if (! isset($start)){ - $start=0; + $start=0; } if ( !$start or $start == 0 and $xoopsModuleConfig['modlimit'] != 0) { - $init = 0; + $init = 0; } elseif ( $start != 0 and $xoopsModuleConfig['modlimit'] != 0) { - $init = $start; + $init = $start; } $admin = 0; if ($xoopsUser) { - $xoopsTpl->assign("partner_join" ,"<a href='join.php'><b>"._MD_JOIN."</b></a>"); + $xoopsTpl->assign("partner_join" ,"<a href='join.php'><b>"._MD_JOIN."</b></a>"); } $query = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("partners")." WHERE status=1"); list($numrows) = $xoopsDB->fetchrow($query); if( $xoopsModuleConfig['modlimit'] != 0 ) { - $partners = $part->getAllPartners("status = 1",true,$xoopsModuleConfig['modorder'],$xoopsModuleConfig['modorderd'],$xoopsModuleConfig['modlimit'],$init); + $partners = $part->getAllPartners("status = 1",true,$xoopsModuleConfig['modorder'],$xoopsModuleConfig['modorderd'],$xoopsModuleConfig['modlimit'],$init); }else{ - $partners = $part->getAllPartners("status = 1",true,$xoopsModuleConfig['modorder'],$xoopsModuleConfig['modorderd']); + $partners = $part->getAllPartners("status = 1",true,$xoopsModuleConfig['modorder'],$xoopsModuleConfig['modorderd']); } foreach ( $partners as $part_obj ) { - $array_partners[] = array( - "id" => $part_obj->getVar("id"), - "hits" => $part_obj->getVar("hits"), - "url" => $part_obj->getVar("url"), - "image" => $part_obj->getVar("image"), - "title" => $part_obj->getVar("title"), - "description" => $part_obj->getVar("description") - ); + $array_partners[] = array( + "id" => $part_obj->getVar("id"), + "hits" => $part_obj->getVar("hits"), + "url" => $part_obj->getVar("url"), + "image" => $part_obj->getVar("image"), + "title" => $part_obj->getVar("title"), + "description" => $part_obj->getVar("description") + ); } $partner_count = count($array_partners); for ( $i = 0; $i < $partner_count; $i++ ) { - $ImagePartner = "<a href='vpartner.php?id=".$array_partners[$i]["id"]."' target='_blank'>"; - if ( !empty($array_partners[$i]["image"]) && ($xoopsModuleConfig['modshow'] == 1 || $xoopsModuleConfig['modshow'] == 3) ) { - $ImagePartner .= "<img src='".$array_partners[$i]["image"]."' alt='".$array_partners[$i]["url"]."' width='102' height='47' border='0' />"; - } - if ( $xoopsModuleConfig['modshow'] == 3 ) { - $ImagePartner .= "<br />"; - } - if ( empty($array_partners[$i]["image"]) || $xoopsModuleConfig['modshow'] == 2 || $xoopsModuleConfig['modshow'] == 3 ) { - $ImagePartner .= $array_partners[$i]["title"]; - } - $ImagePartner .= "</a>"; - $partner[$i]['id'] = $array_partners[$i]['id']; - $partner[$i]['hits'] = $array_partners[$i]['hits']; - $partner[$i]['url'] = $array_partners[$i]['url']; - $partner[$i]['image'] = $ImagePartner; - $partner[$i]['title'] = $array_partners[$i]['title']; - $partner[$i]['description'] = $array_partners[$i]['description']; - if ($xoopsUserIsAdmin) { - $partner[$i]['admin_option'] = "<br />[<a href='admin/index.php?op=editPartner&id=".$array_partners[$i]["id"]."'>"._MD_EDIT."</a>] [<a href='admin/index.php?op=delPartner&id=".$array_partners[$i]["id"]."'>"._MD_DELETE."</a>]"; - } - $xoopsTpl->append("partners", $partner[$i]); + $ImagePartner = "<a href='vpartner.php?id=".$array_partners[$i]["id"]."' target='_blank'>"; + if ( !empty($array_partners[$i]["image"]) && ($xoopsModuleConfig['modshow'] == 1 || $xoopsModuleConfig['modshow'] == 3) ) { + $ImagePartner .= "<img src='".$array_partners[$i]["image"]."' alt='".$array_partners[$i]["url"]."' width='102' height='47' border='0' />"; + } + if ( $xoopsModuleConfig['modshow'] == 3 ) { + $ImagePartner .= "<br />"; + } + if ( empty($array_partners[$i]["image"]) || $xoopsModuleConfig['modshow'] == 2 || $xoopsModuleConfig['modshow'] == 3 ) { + $ImagePartner .= $array_partners[$i]["title"]; + } + $ImagePartner .= "</a>"; + $partner[$i]['id'] = $array_partners[$i]['id']; + $partner[$i]['hits'] = $array_partners[$i]['hits']; + $partner[$i]['url'] = $array_partners[$i]['url']; + $partner[$i]['image'] = $ImagePartner; + $partner[$i]['title'] = $array_partners[$i]['title']; + $partner[$i]['description'] = $array_partners[$i]['description']; + if ($xoopsUserIsAdmin) { + $partner[$i]['admin_option'] = "<br />[<a href='admin/index.php?op=editPartner&id=".$array_partners[$i]["id"]."'>"._MD_EDIT."</a>] [<a href='admin/index.php?op=delPartner&id=".$array_partners[$i]["id"]."'>"._MD_DELETE."</a>]"; + } + $xoopsTpl->append("partners", $partner[$i]); } if ( $xoopsModuleConfig['modlimit'] != 0 ) { - $nav = new XoopsPageNav($numrows,$xoopsModuleConfig['modlimit'],$start); - $pagenav = $nav->renderImageNav(); + $nav = new XoopsPageNav($numrows,$xoopsModuleConfig['modlimit'],$start); + $pagenav = $nav->renderImageNav(); } $xoopsTpl->assign(array( - "lang_partner" => _MD_PARTNER, - "lang_desc" => _MD_DESCRIPTION, - "lang_hits" => _MD_HITS, - "lang_no_partners" => _MD_NOPART, - "lang_main_partner" => _MD_PARTNERS, - "sitename" => $xoopsConfig['sitename'], - "pagenav" => $pagenav - )); + "lang_partner" => _MD_PARTNER, + "lang_desc" => _MD_DESCRIPTION, + "lang_hits" => _MD_HITS, + "lang_no_partners" => _MD_NOPART, + "lang_main_partner" => _MD_PARTNERS, + "sitename" => htmlspecialchars($xoopsConfig['sitename']), + "pagenav" => $pagenav + )); include_once XOOPS_ROOT_PATH.'/footer.php'; ?> \ No newline at end of file Index: xoops2jp/html/modules/xoopspartners/join.php diff -u xoops2jp/html/modules/xoopspartners/join.php:1.2 xoops2jp/html/modules/xoopspartners/join.php:1.3 --- xoops2jp/html/modules/xoopspartners/join.php:1.2 Fri Mar 18 21:52:49 2005 +++ xoops2jp/html/modules/xoopspartners/join.php Sat Jun 11 11:32:57 2005 @@ -1,5 +1,5 @@ <?php -// $Id: join.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $ +// $Id: join.php,v 1.3 2005/06/11 02:32:57 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -33,110 +33,109 @@ include XOOPS_ROOT_PATH."/header.php"; $myts =& MyTextSanitizer::getInstance(); if ( $xoopsUser ){ - if ( $HTTP_POST_VARS['op'] == "sendMail" ) { - extract($HTTP_POST_VARS); - include XOOPS_ROOT_PATH."/class/xoopsmailer.php"; - if ( empty($title) or empty($url) or empty($description) or $url == "http://" ) { - $xoopsTpl->assign(array( - "content4join" => _MD_ERROR1, - "lang_main_partner" => _MD_PARTNERS, - "sitename" => $xoopsConfig['sitename'] - )); - $xoopsContentsTpl = 'partnerjoin.html'; - include_once XOOPS_ROOT_PATH.'/footer.php'; - exit(); - } - $url = formatURL($myts->makeTboxData4Show($url)); - $image = formatURL($myts->makeTboxData4Show($image)); - $title = $myts->makeTboxData4Show($title); - $description = $myts->makeTboxData4Show($description); - $imageInfo = @getimagesize($image); - $imageWidth = $imageInfo[0]; - $imageHeight = $imageInfo[1]; - $type = $imageInfo[2]; - if ($type == 0) { - $xoopsTpl->assign(array( - "content4join" => _MD_ERROR3, - "lang_main_partner" => _MD_PARTNERS, - "sitename" => $xoopsConfig['sitename'] - )); - $xoopsContentsTpl = 'partnerjoin.html'; - include_once XOOPS_ROOT_PATH.'/footer.php'; - exit(); - } - if ( $imageWidth >= 110 or $imageHeight >=50 ) { - $xoopsTpl->assign(array( - "content4join" => _MD_ERROR2, - "lang_main_partner" => _MD_PARTNERS, - "sitename" => $xoopsConfig['sitename'] - )); - $xoopsContentsTpl = 'partnerjoin.html'; - include_once XOOPS_ROOT_PATH.'/footer.php'; - exit(); - } - if( $image == "http://" ) { - $image = ""; - } - $xoopsMailer =& getMailer(); - $xoopsMailer->useMail(); - $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/xoopspartners/language/'.$xoopsConfig['language'].'/'); - $xoopsMailer->setTemplate("join.tpl"); - $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']); - $xoopsMailer->assign("SITEURL", XOOPS_URL."/"); - $xoopsMailer->assign("IP", $HTTP_SERVER_VARS['REMOTE_ADDR']); - $xoopsMailer->assign("URL", $url); - $xoopsMailer->assign("IMAGE", $image); - $xoopsMailer->assign("TITLE", $title); - $xoopsMailer->assign("DESCRIPTION", $description); - $xoopsMailer->assign("USER", $xoopsUser->getVar("uname")); - $xoopsMailer->setToEmails($xoopsConfig['adminmail']); - $xoopsMailer->setFromEmail($xoopsUser->getVar("email")); - $xoopsMailer->setFromName($xoopsUser->getVar("uname")); - $xoopsMailer->setSubject(sprintf(_MD_NEWPARTNER,$xoopsConfig['sitename'])); - if ( !$xoopsMailer->send() ) { - $xoopsTpl->assign(array( - "content4join" => "<br />".$xoopsMailer->getErrors()._MD_GOBACK, - "lang_main_partner" => _MD_PARTNERS, - "lang_join" => _MD_JOIN, - "sitename" => $xoopsConfig['sitename'] - )); - } else { - $xoopsTpl->assign(array( - "content4join" => "<br />"._MD_SENDMAIL, - "lang_main_partner" => _MD_PARTNERS, - "lang_join" => _MD_JOIN, - "sitename" => $xoopsConfig['sitename'] - )); - } - $xoopsContentsTpl = 'partnerjoin.html'; - } else { - include XOOPS_ROOT_PATH."/class/xoopsformloader.php"; - $form = new XoopsThemeForm("", "joinform", "join.php"); - $titlePartern = new XoopsFormText(_MD_TITLE, "title", 30, 50); - $imagePartern = new XoopsFormText(_MD_IMAGE, "image", 30, 150, "http://"); - $urlPartern = new XoopsFormText(_MD_URL, "url", 30, 150, "http://"); - $descriptionPartern = new XoopsFormTextArea(_MD_DESCRIPTION, "description","", 7, 50); - $op_hidden = new XoopsFormHidden("op", "sendMail"); - $submit_button = new XoopsFormButton("", "dbsubmit", _MD_SEND, "submit"); - $form->addElement($titlePartern); - $form->addElement($imagePartern); - $form->addElement($urlPartern); - $form->addElement($descriptionPartern); - $form->addElement($op_hidden); - $form->addElement($submit_button); - $form->setRequired($titlePartern); - $form->setRequired($urlPartern); - $form->setRequired($descriptionPartern); - $content = $form->render(); - $xoopsTpl->assign(array( - "content4join" => $content, - "lang_main_partner" => _MD_PARTNERS, - "lang_join" => _MD_JOIN, - "sitename" => $xoopsConfig['sitename'] - )); - } + if ( !empty($_POST['op']) && $_POST['op'] == "sendMail" ) { + include XOOPS_ROOT_PATH."/class/xoopsmailer.php"; + if ( empty($_POST['title']) or empty($_POST['url']) or empty($_POST['description']) or $_POST['url'] == "http://" ) { + $xoopsTpl->assign(array( + "content4join" => _MD_ERROR1, + "lang_main_partner" => _MD_PARTNERS, + "sitename" => htmlspecialchars($xoopsConfig['sitename']) + )); + $xoopsContentsTpl = 'partnerjoin.html'; + include_once XOOPS_ROOT_PATH.'/footer.php'; + exit(); + } + $url = formatURL($myts->makeTboxData4Show($_POST['url'])); + $image = formatURL($myts->makeTboxData4Show($_POST['image'])); + $title = $myts->makeTboxData4Show($_POST['title']); + $description = $myts->makeTboxData4Show($_POST['description']); + $imageInfo = @getimagesize($image); + $imageWidth = $imageInfo[0]; + $imageHeight = $imageInfo[1]; + $type = $imageInfo[2]; + if ($type == 0) { + $xoopsTpl->assign(array( + "content4join" => _MD_ERROR3, + "lang_main_partner" => _MD_PARTNERS, + "sitename" => htmlspecialchars($xoopsConfig['sitename']) + )); + $xoopsContentsTpl = 'partnerjoin.html'; + include_once XOOPS_ROOT_PATH.'/footer.php'; + exit(); + } + if ( $imageWidth >= 110 or $imageHeight >=50 ) { + $xoopsTpl->assign(array( + "content4join" => _MD_ERROR2, + "lang_main_partner" => _MD_PARTNERS, + "sitename" => htmlspecialchars($xoopsConfig['sitename']) + )); + $xoopsContentsTpl = 'partnerjoin.html'; + include_once XOOPS_ROOT_PATH.'/footer.php'; + exit(); + } + if( $image == "http://" ) { + $image = ""; + } + $xoopsMailer =& getMailer(); + $xoopsMailer->useMail(); + $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/xoopspartners/language/'.$xoopsConfig['language'].'/'); + $xoopsMailer->setTemplate("join.tpl"); + $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']); + $xoopsMailer->assign("SITEURL", XOOPS_URL."/"); + $xoopsMailer->assign("IP", $HTTP_SERVER_VARS['REMOTE_ADDR']); + $xoopsMailer->assign("URL", $url); + $xoopsMailer->assign("IMAGE", $image); + $xoopsMailer->assign("TITLE", $title); + $xoopsMailer->assign("DESCRIPTION", $description); + $xoopsMailer->assign("USER", $xoopsUser->getVar("uname")); + $xoopsMailer->setToEmails($xoopsConfig['adminmail']); + $xoopsMailer->setFromEmail($xoopsUser->getVar("email")); + $xoopsMailer->setFromName($xoopsUser->getVar("uname")); + $xoopsMailer->setSubject(sprintf(_MD_NEWPARTNER,$xoopsConfig['sitename'])); + if ( !$xoopsMailer->send() ) { + $xoopsTpl->assign(array( + "content4join" => "<br />".$xoopsMailer->getErrors()._MD_GOBACK, + "lang_main_partner" => _MD_PARTNERS, + "lang_join" => _MD_JOIN, + "sitename" => htmlspecialchars($xoopsConfig['sitename']) + )); + } else { + $xoopsTpl->assign(array( + "content4join" => "<br />"._MD_SENDMAIL, + "lang_main_partner" => _MD_PARTNERS, + "lang_join" => _MD_JOIN, + "sitename" => htmlspecialchars($xoopsConfig['sitename']) + )); + } + $xoopsContentsTpl = 'partnerjoin.html'; + } else { + include XOOPS_ROOT_PATH."/class/xoopsformloader.php"; + $form = new XoopsThemeForm("", "joinform", "join.php"); + $titlePartern = new XoopsFormText(_MD_TITLE, "title", 30, 50); + $imagePartern = new XoopsFormText(_MD_IMAGE, "image", 30, 150, "http://"); + $urlPartern = new XoopsFormText(_MD_URL, "url", 30, 150, "http://"); + $descriptionPartern = new XoopsFormTextArea(_MD_DESCRIPTION, "description","", 7, 50); + $op_hidden = new XoopsFormHidden("op", "sendMail"); + $submit_button = new XoopsFormButton("", "dbsubmit", _MD_SEND, "submit"); + $form->addElement($titlePartern); + $form->addElement($imagePartern); + $form->addElement($urlPartern); + $form->addElement($descriptionPartern); + $form->addElement($op_hidden); + $form->addElement($submit_button); + $form->setRequired($titlePartern); + $form->setRequired($urlPartern); + $form->setRequired($descriptionPartern); + $content = $form->render(); + $xoopsTpl->assign(array( + "content4join" => $content, + "lang_main_partner" => _MD_PARTNERS, + "lang_join" => _MD_JOIN, + "sitename" => htmlspecialchars($xoopsConfig['sitename']) + )); + } } else { // else -- if ( $xoopsUser ) - redirect_header("index.php",2,_NOPERM); + redirect_header("index.php",2,_NOPERM); } include_once XOOPS_ROOT_PATH.'/footer.php'; ?> \ No newline at end of file