11
mramsey
Adding Email Attachments
  • 2005/5/6 6:52

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


I am having a fair bit of trouble figuring out how to send attachments via email. Those familiar with these types of message source formats will know that I need to add a short line in to the headers and then encapsulate the file in to the body with a 'head' and 'foot'.

I have looked at the functions available in:

/class/xoopsmailer.php
and
/class/mail/xoopsmultimailer.php

Apparently xoopsmultimailer.php has a class called XoopsMultiMailer which 'extends' XoopsMultiMailer the same class found in:

/class/mail/phpmailer/class.phpmailer.php

I have read the docs for the base phpmailer and it looks like it has fairly sophisticated mail attachment functions which look as though they will do exactly what I need.

My question is, how should I go about accessing them through the standard email functions built in to XOOPS 2 (xoops 2.0.10)?

Currently I have:

$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setToEmails($xoopsConfig['adminmail']);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject($subject);
$xoopsMailer->setBody($message);

$xoopsMailer->send();

Which is working find, but i havent tried to attach anything yet...

$xoopsMailer->multimailer->AddStringAttachment($string, $attachment, "base64", "application/octet-stream");

In PHPMailer documentation they talk about this below;

Adds a string or binary attachment (non-filesystem) to the list.

This method can be used to attach ascii or binary data, such as a BLOB record from a database.

void AddStringAttachment (string $string, string $filename, [string $encoding = "base64"], [string $type = "application/octet-stream"])
string $string:
String attachment data.

string $filename:
Name of the attachment.

string $encoding:
File encoding (see $Encoding).

string $type:
File extension (MIME) type.

And that chich exactly what I need.

What could be the (string $string) to allow the form work?

Any ideas would be greatly appreciated



12
mramsey
Help!!!
  • 2005/5/6 5:02

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


I have created a form to email with attachment

<input type=\"file\" name=\"attachment\" value=\"\" class=\'text_box\' size=\"20\">

And when I use $xoopsMailer->multimailer->AddAttachment the full path to the file from the server I can get the email with attachment $xoopsMailer->multimailer->AddAttachment('/home/fullpath/uploads/test.zip');

But, when I use $xoopsMailer->multimailer->AddAttachment to load the file from the form I created $xoopsMailer->multimailer->AddAttachment($attachment);, it send the email without attachment.

I know that PHPMailer it dose support this functionality.

Xoops experts, do you know why this method doesn't work?

Thanks.



13
mramsey
Re: I need some help with $xoopsMailer
  • 2005/5/4 10:33

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


Hi there,

I am not a PHP programmer, but I need to get this form working.

I've changed $xoopsMailer->charSet($attachment); to $xoopsMailer->multimailer->addAttachment(); but still the form does not send any attachment.

Could you please let know what do I have to add to the form to get it work?

Thanks.



14
mramsey
I need some help with $xoopsMailer
  • 2005/5/3 7:28

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


I have a job listing module and I've added an attachment to the form below to allow the users to send an email with attachment CV’s.

The form is working fine but I can not get any attachment with the email, I used $xoopsMailer->charSet but it doesn't work.

Could you please help me to know; what is my problem with this form? Why it doesn't send the attachment with the email?

Below in RED what I have been added to the form to allow attachment.

<?php

foreach ($_POST as $k => $v) {
${$k} = $v;
}

if ($submit) {
include("header.php");
global $xoopsConfig, $xoopsDB, $myts, $meta;

$result = $xoopsDB->query("select email, submitter, title, type, company, description, requirements FROM ".$xoopsDB->prefix("jobs_listing")." WHERE lid = '$id'");

while(list($email, $submitter, $title, $type, $company, $description, $requirements) = $xoopsDB->fetchRow($result)) {
$title = $myts->makeTboxData4Show($title);
$type = $myts->makeTboxData4Show($type);
$company = $myts->makeTboxData4Show($company);
$description = $myts->makeTboxData4Show($description);
$requirements = $myts->makeTboxData4Show($requirements);
$submitter = $myts->makeTboxData4Show($submitter);
if ($tele) {
$teles = ""._JOBS_ORAT." $tele";
} else {
$teles = "";
}

$message .= ""._JOBS_REMINDANN." $type : $title "._JOBS_FROMANNOF." $sitename\n";
$message .= ""._JOBS_MESSFROM." $namep $post ".$meta['title']."\n\n";
$message .= "\n";
$message .= stripslashes("$messtext\n\n");
$message .= " "._JOBS_ENDMESS."\n\n";
$message .= ""._JOBS_CANJOINT." $namep "._JOBS_TO." $post $teles \n\n";
$message .= "End of message \n\n";

$subject = ""._JOBS_CONTACTAFTERANN."";
$mail =& getMailer();
$mail->useMail();
//$mail->setFromName($meta['title']);
$mail->setFromEmail($post);
$mail->setToEmails($email);
$mail->setSubject($subject);
$mail->setBody($message);
$mail->send();
echo $mail->getErrors();

$message .= "\n".$_SERVER['REMOTE_ADDR']."\n";
$adsubject = $xoopsConfig['sitename']." Job Reply ";
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setToEmails($xoopsConfig['adminmail']);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject($adsubject);
$xoopsMailer->setBody($message);
$xoopsMailer->charSet($attachment);
$xoopsMailer->send();

}
redirect_header("index.php",1,_JOBS_MESSEND);
exit();

} else {

$lid = isset( $_GET['lid'] ) ? $_GET['lid'] : '' ;

include("header.php");
include(XOOPS_ROOT_PATH."/header.php");
OpenTable();

echo "<script type=\"text/javascript\">
function verify() {
var msg = \""._JOBS_VALIDERORMSG."\\n__________________________________________________\\n\\n\";
var errors = \"FALSE\";


if (document.cont.namep.value == \"\") {
errors = \"TRUE\";
msg += \""._JOBS_VALIDSUBMITTER."\\n\";
}

if (document.cont.post.value == \"\") {
errors = \"TRUE\";
msg += \""._JOBS_VALIDEMAIL."\\n\";
}


if (document.cont.tele.value == \"\") {
errors = \"TRUE\";
msg += \""._JOBS_VALIDTELE."\\n\";
}

if (document.cont.messtext.value == \"\") {
errors = \"TRUE\";
msg += \""._JOBS_VALIDMESS."\\n\";
}


if (errors == \"TRUE\") {
msg += \"__________________________________________________\\n\\n"._JOBS_VALIDMSG."\\n\";
alert(msg);
return false;
}
}
</script>";


echo "<b>"._JOBS_CONTACTAUTOR."</b><br /><br />";
echo ""._JOBS_TEXTAUTO."<br />";
echo "<form onsubmit=\"return verify();\" method=\"post\" action=\"contact.php\" name=\"cont\">";
echo "<input type=\"hidden\" name=\"id\" value=\"$lid\" />";
echo "<input type=\"hidden\" name=\"submit\" value=\"1\" />";

if($xoopsUser) {
$idd =$xoopsUser->getVar("name", "E");
$idde =$xoopsUser->getVar("email", "E");
}

echo "<table width='100%' class='outer' cellspacing='1'>
<tr>
<td class='head'>"._JOBS_YOURNAME."</td>
<td class='even'><input type=\"text\" name=\"namep\" size=\"40\" value=\"$idd\" /></td>
</tr>
<tr>
<td class='head'>"._JOBS_YOUREMAIL."</td>
<td class='even'><input type=\"text\" name=\"post\" size=\"40\" value=\"$idde\" /></td>
</tr>
<tr>
<td class='head'>"._JOBS_YOURPHONE."</td>
<td class='even'><input type=\"text\" name=\"tele\" size=\"40\" /></td>
</tr>
<tr>
<td class='head'>"._JOBS_YOURMESSAGE."</td>
<td class='even'><textarea rows=\"5\" name=\"messtext\" cols=\"40\"></textarea></td>
</tr>
<tr>
<td class='head'>Attach your resume </td>
<td class='even'><input type=\"file\" name=\"attachment\" value=\"\" class=\'text_box\' size=\"20\"></td>

</tr>
</table>
<br />
<p><input type=\"submit\" value=\""._JOBS_SENDFR."\" /></p>
</form>";

CloseTable();
include(XOOPS_ROOT_PATH."/footer.php");
}

?>

<tr>



15
mramsey
Does xoops support form 2 email with Attachment?
  • 2005/4/27 6:53

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


Hi All,

Does XOOPS support form 2 email with Attachment?

I am using job listing module 1.8 fromhttp://www.jlmzone.com/modules/news/ and when you apply to the job in the contact.php form it doesn't have an option to send Attachment.

I've modified the form and added the option to attach any file but I don’t know how to program the PHP code and I am still receiving the email without attachment.

I know there are a lot of expertises of PHP programming out there, I just asking for your help.

You can download the module from this link below.
http://www.jlmzone.com/modules/mydownloads/

Can you help me PLEASE!!!

Thanks




16
mramsey
Re: I need some help please
  • 2005/4/23 7:16

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


[size=x-large]I need some help please[/size]



17
mramsey
I need some help please
  • 2005/4/22 6:47

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


Hi All,

I have a job listing module and I've added an attachment option to the contact form to allow the users to email the CV’s.

Can anyone please help me with this PHP code to allow sending the attachment to Email?

<?php
// ----------------------------------------------------------------------- //
// Jobs for XOOPS 2.0x //
// By John Mordo from the myAds 2.04 Module //
// All Original credits left below this //
// //
// //
// //
//
// ------------------------------------------------------------------------- //
// E-Xoops: Content Management for the Masses //
// <http://www.e-xoops.com > //
// ------------------------------------------------------------------------- //
// Original Author: Pascal Le Boustouller
// Author Website : pascal.e-xoops@perso-search.com
// Licence Type : GPL
// ------------------------------------------------------------------------- //

foreach ($HTTP_POST_VARS as $k => $v) {
${$k} = $v;
}

if ($submit) {
include("header.php");
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
global $xoopsConfig, $xoopsDB, $myts, $meta;

$result = $xoopsDB->query("select email, submitter, title, type, company, description, requirements FROM ".$xoopsDB->prefix("jobs_listing")." WHERE lid = '$id'");

while(list($email, $submitter, $title, $type, $company, $description, $requirements) = $xoopsDB->fetchRow($result)) {
$title = $myts->makeTboxData4Show($title);
$type = $myts->makeTboxData4Show($type);
$company = $myts->makeTboxData4Show($company);
$description = $myts->makeTboxData4Show($description);
$requirements = $myts->makeTboxData4Show($requirements);
$submitter = $myts->makeTboxData4Show($submitter);

if ($tele) {
$teles = ""._CLA_ORAT." $tele";
} else {
$teles = "";
}

$message = ""._CLA_MESSFROM." $namep $post ".$meta['title']."\n\n\n";
$message .= ""._CLA_REMINDANN." $type : $title\n"._CLA_MESSAGETEXT." : $description\n\n";
$message .= " "._CLA_STARTMESS." $namep "._CLA_FROMANNOF."\n";
$message .= "$messtext\n\n";
$message .= "--------------- "._CLA_ENDMESS." -------------------\n\n";
$message .= ""._CLA_CANJOINT." $namep "._CLA_TO." $post $teles \n\n";
$message .= "End of message \n\n";

$subject = ""._CLA_CONTACTAFTERANN."";
$mail =& getMailer();
$mail->useMail();
//$mail->setFromName($meta['title']);
$mail->setFromEmail($post);
$mail->setToEmails($email);
$mail->setSubject($subject);
$mail->setBody($message);
$mail->send();
echo $mail->getErrors();
}
redirect_header("index.php",1,_CLA_MESSEND);
exit();

} else {

$lid = isset( $HTTP_GET_VARS['lid'] ) ? $HTTP_GET_VARS['lid'] : '' ;

include("header.php");
include(XOOPS_ROOT_PATH."/header.php");
OpenTable();

echo "<script>
function verify() {
var msg = \""._CLA_VALIDERORMSG."\\n__________________________________________________\\n\\n\";
var errors = \"FALSE\";


if (document.Cont.namep.value == \"\") {
errors = \"TRUE\";
msg += \""._CLA_VALIDSUBMITTER."\\n\";
}

if (document.Cont.post.value == \"\") {
errors = \"TRUE\";
msg += \""._CLA_VALIDEMAIL."\\n\";
}

if (document.Cont.messtext.value == \"\") {
errors = \"TRUE\";
msg += \""._CLA_VALIDMESS."\\n\";
}


if (errors == \"TRUE\") {
msg += \"__________________________________________________\\n\\n"._CLA_VALIDMSG."\\n\";
alert(msg);
return false;
}
}
</script>";


echo "<B>"._CLA_CONTACTAUTOR."</B><BR><BR>";
echo ""._CLA_TEXTAUTO."<BR>";
echo "<form onSubmit=\"return verify();\" method=\"post\" action=\"contact.php\" NAME=\"Cont\">";
echo "<INPUT TYPE=\"hidden\" NAME=\"id\" VALUE=\"$lid\">";
echo "<INPUT TYPE=\"hidden\" NAME=\"submit\" VALUE=\"1\">";

if($xoopsUser) {
$idd =$xoopsUser->getVar("name", "E");
$idde =$xoopsUser->getVar("email", "E");
}

echo "<TABLE width='100%' class='outer' cellspacing='1'>
<TR>
<TD class='head'>"._CLA_YOURNAME."</TD>
<TD class='even'><input type=\"text\" name=\"namep\" size=\"32\" value=\"$idd\"></TD>
</TR>
<TR>
<TD class='head'>"._CLA_YOUREMAIL."</TD>
<TD class='even'><input type=\"text\" name=\"post\" size=\"32\" value=\"$idde\"></font></TD>
</TR>
<TR>
<TD class='head'>"._CLA_YOURPHONE."</TD>
<TD class='even'><input type=\"text\" name=\"tele\" size=\"32\"></font></TD>
</TR>
<TR>
<TD class='head'>"._CLA_YOURMESSAGE."</TD>
<TD class='even'><textarea rows=\"5\" name=\"messtext\" cols=\"30\"></textarea></TD>
</TR>
<tr>
<td class='head'>"._JOBS_ATTACHMENT."</td>
<td class='even'><input type=\"file\" name=\"attachment\" size=\"16\"/></td>
</tr>

</TABLE><br />
<p><INPUT TYPE=\"submit\" VALUE=\""._CLA_SENDFR."\">
</form>";

CloseTable();
include(XOOPS_ROOT_PATH."/footer.php");
}

?>



18
mramsey
New suggestion for the new Xoops Core for userinfo.php
  • 2005/4/12 10:18

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


Hi All,

I’ve done a hack to userinfo.php to stop any other users to have access the personal account details of another user due to our registration & privacy obligations.

So if you can implement it to the new XOOPS core.

Also if you can have the entire user menu such as (edituser.php, lostpass.php, notifications.php, register.php, user.php, userinfo.php, viewpmsg.php) as a Module, so we can have an access to modify any information required such as we can enable or disable PM.

I am not a PHP programmer, but I learned PHP from Xoops, thank you teams.

It has two modifications
1- The userinfo.php hack
2- The new 'user_info_not.html' under the system modules.

USERINFO.PHP
<?php
// $Id: userinfo.php,v 1.18 2004/12/26 19:11:48 Onokazu Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <https://xoops.org/> //
// ------------------------------------------------------------------------ //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //

$xoopsOption['pagetype'] = 'user';
include 'mainfile.php';
include_once XOOPS_ROOT_PATH.'/class/module.textsanitizer.php';

include_once XOOPS_ROOT_PATH . '/modules/system/constants.php';

$uid = intval($_GET['uid']);
if ($uid <= 0) {
redirect_header('index.php', 3, _US_SELECTNG);
exit();
}

$gperm_handler = & xoops_gethandler( 'groupperm' );

$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;

$isAdmin = $gperm_handler->checkRight( 'system_admin', XOOPS_SYSTEM_USER, $groups); // isadmin is true if user has 'edit users' admin rights

if (is_object($xoopsUser)) {
if ($uid == $xoopsUser->getVar('uid')) {
$config_handler =& xoops_gethandler('config');
$xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
$xoopsOption['template_main'] = 'system_userinfo.html';
include XOOPS_ROOT_PATH.'/header.php';
$xoopsTpl->assign('user_ownpage', true);
$xoopsTpl->assign('lang_editprofile', _US_EDITPROFILE);
$xoopsTpl->assign('lang_avatar', _US_AVATAR);
$xoopsTpl->assign('lang_inbox', _US_INBOX);
$xoopsTpl->assign('lang_logout', _US_LOGOUT);
if ($xoopsConfigUser['self_delete'] == 1) {
$xoopsTpl->assign('user_candelete', true);
$xoopsTpl->assign('lang_deleteaccount', _US_DELACCOUNT);
} else {
$xoopsTpl->assign('user_candelete', false);
}
$thisUser =& $xoopsUser;
} else {
$member_handler =& xoops_gethandler('member');
$thisUser =& $member_handler->getUser($uid);
if (!is_object($thisUser) || !$thisUser->isActive() ) {
redirect_header("index.php",3,_US_SELECTNG);
exit();
}
$xoopsOption['template_main'] = 'user_info_not.html';
include XOOPS_ROOT_PATH.'/header.php';
$xoopsTpl->assign('user_ownpage', false);
}
} else {
$member_handler =& xoops_gethandler('member');
$thisUser =& $member_handler->getUser($uid);
if (!is_object($thisUser) || !$thisUser->isActive()) {
redirect_header("index.php",3,_US_SELECTNG);
exit();
}
$xoopsOption['template_main'] = 'user_info_not.html';
include(XOOPS_ROOT_PATH.'/header.php');
$xoopsTpl->assign('user_ownpage', false);
}
$myts =& MyTextSanitizer::getInstance();
if ( is_object($xoopsUser) && $isAdmin ) {
$xoopsTpl->assign('lang_editprofile', _US_EDITPROFILE);
$xoopsTpl->assign('lang_deleteaccount', _US_DELACCOUNT);
$xoopsTpl->assign('user_uid', $thisUser->getVar('uid'));
}
$xoopsTpl->assign('lang_allaboutuser', sprintf(_US_ALLABOUT,$thisUser->getVar('uname')));
$xoopsTpl->assign('lang_avatar', _US_AVATAR);
$xoopsTpl->assign('user_avatarurl', 'uploads/'.$thisUser->getVar('user_avatar'));
$xoopsTpl->assign('lang_realname', _US_REALNAME);
$xoopsTpl->assign('user_realname', $thisUser->getVar('name'));
$xoopsTpl->assign('lang_website', _US_WEBSITE);
$xoopsTpl->assign('user_websiteurl', '<a href="'.$thisUser->getVar('url', 'E').'" target="_blank">'.$thisUser->getVar('url').'</a>');
$xoopsTpl->assign('lang_email', _US_EMAIL);
$xoopsTpl->assign('lang_privmsg', _US_PM);
$xoopsTpl->assign('lang_icq', _US_ICQ);
$xoopsTpl->assign('user_icq', $thisUser->getVar('user_icq'));
$xoopsTpl->assign('lang_aim', _US_AIM);
$xoopsTpl->assign('user_aim', $thisUser->getVar('user_aim'));
$xoopsTpl->assign('lang_yim', _US_YIM);
$xoopsTpl->assign('user_yim', $thisUser->getVar('user_yim'));
$xoopsTpl->assign('lang_msnm', _US_MSNM);
$xoopsTpl->assign('user_msnm', $thisUser->getVar('user_msnm'));
$xoopsTpl->assign('lang_location', _US_LOCATION);
$xoopsTpl->assign('user_location', $thisUser->getVar('user_from'));
$xoopsTpl->assign('lang_interest', _US_INTEREST);
$xoopsTpl->assign('user_interest', $thisUser->getVar('user_intrest'));
$xoopsTpl->assign('lang_occupation', _US_OCCUPATION);
$xoopsTpl->assign('user_occupation', $thisUser->getVar('user_occ'));
$xoopsTpl->assign('lang_extrainfo', _US_EXTRAINFO);
$xoopsTpl->assign('user_extrainfo', $myts->makeTareaData4Show($thisUser->getVar('bio', 'N'),0,1,1));
$xoopsTpl->assign('lang_statistics', _US_STATISTICS);
$xoopsTpl->assign('lang_membersince', _US_MEMBERSINCE);
$xoopsTpl->assign('user_joindate', formatTimestamp($thisUser->getVar('user_regdate'),'s'));
$xoopsTpl->assign('lang_rank', _US_RANK);
$xoopsTpl->assign('lang_posts', _US_POSTS);
$xoopsTpl->assign('lang_basicInfo', _US_BASICINFO);
$xoopsTpl->assign('lang_more', _US_MOREABOUT);
$xoopsTpl->assign('lang_myinfo', _US_MYINFO);
$xoopsTpl->assign('user_posts', $thisUser->getVar('posts'));
$xoopsTpl->assign('lang_lastlogin', _US_LASTLOGIN);
$xoopsTpl->assign('lang_notregistered', _US_NOTREGISTERED);

$xoopsTpl->assign('lang_signature', _US_SIGNATURE);
$xoopsTpl->assign('user_signature', $myts->makeTareaData4Show($thisUser->getVar('user_sig', 'N'),0,1,1));

if ($thisUser->getVar('user_viewemail') == 1) {
$xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E'));
} else {
if (is_object($xoopsUser)) {
// All admins will be allowed to see emails, even those that are not allowed to edit users (I think it's ok like this)
if ($xoopsUserIsAdmin || ($xoopsUser->getVar("uid") == $thisUser->getVar("uid"))) {
$xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E'));
} else {
$xoopsTpl->assign('user_email', '&nbsp;');
}
}
}
if (is_object($xoopsUser)) {
$xoopsTpl->assign('user_pmlink', "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/pmlite.php?send2=1&to_userid=".$thisUser->getVar('uid')."', 'pmlite', 450, 380);\"><img src=\"".XOOPS_URL."/images/icons/pm.gif\" alt=\"".sprintf(_SENDPMTO,$thisUser->getVar('uname'))."\" /></a>");
} else {
$xoopsTpl->assign('user_pmlink', '');
}
$userrank =& $thisUser->rank();
if ($userrank['image']) {
$xoopsTpl->assign('user_rankimage', '<img src="'.XOOPS_UPLOAD_URL.'/'.$userrank['image'].'" alt="" />');
}
$xoopsTpl->assign('user_ranktitle', $userrank['title']);
$date = $thisUser->getVar("last_login");
if (!empty($date)) {
$xoopsTpl->assign('user_lastlogin', formatTimestamp($date,"m"));
}


$module_handler =& xoops_gethandler('module');
$criteria = new CriteriaCompo(new Criteria('hassearch', 1));
$criteria->add(new Criteria('isactive', 1));
$mids =& array_keys($module_handler->getList($criteria));

foreach ($mids as $mid) {
// Hack by marcan : only return results of modules for which user has access permission
if ( $gperm_handler->checkRight('module_read', $mid, $groups)) {
$module =& $module_handler->get($mid);
$results =& $module->search('', '', 5, 0, $thisUser->getVar('uid'));
$count = count($results);
if (is_array($results) && $count > 0) {
for ($i = 0; $i < $count; $i++) {
if (isset($results[$i]['image']) && $results[$i]['image'] != '') {
$results[$i]['image'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['image'];
} else {
$results[$i]['image'] = 'images/icons/posticon2.gif';
}
$results[$i]['link'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['link'];
$results[$i]['title'] = $myts->makeTboxData4Show($results[$i]['title']);
$results[$i]['time'] = $results[$i]['time'] ? formatTimestamp($results[$i]['time']) : '';
}
if ($count == 5) {
$showall_link = '<a href="search.php?action=showallbyuser&mid='.$mid.'&uid='.$thisUser->getVar('uid').'">'._US_SHOWALL.'</a>';
} else {
$showall_link = '';
}
$xoopsTpl->append('modules', array('name' => $module->getVar('name'), 'results' => $results, 'showall_link' => $showall_link));
}
unset($module);
}
}
include XOOPS_ROOT_PATH.'/footer.php';
?>

USER_INFO_NOT.HTML
<p><html> <br>
<head> <br>
</head> <br>
<body > <br>
<center><br>
<br><br><br>
<table border="1" cellpadding="0" cellspacing="0" width="480"
style="border-collapse: collapse" bordercolor="#111111"><br>
<tr><br>
<td bgcolor="#314671" align="center"><img border="0" src="../../images/oops.gif"></td><br>
</tr><br>
<tr><br>
<td align="center"><b><br><br>
You have tried to access the personal account details of another user.<br><br>Due
to our registration & privacy obligations,<br>we do not allow such access.<br><br><br>
If you would like to contact the webmaster or the My web site<br><br>Please
email : <br>
<a href="mailto:email@localhost.com">email@localhost.com</a><br><br></b><br>
<b>You will be redirected...<br><br>
<br><br>
&nbsp;Thank you!<br><br>
&nbsp;</b></td><br>
</tr><br>
</table><br>
<h3>&nbsp;</h3><br>
<form name="redirect"> <br>
<input type="text" size="1" name="redirect2"> <br>
</form> <br>
<script> <br>
var targetURL="http://www.localhost.com/index.php" <br>
var countdownfrom=15 <br>
var currentsecond=document.redirect.redirect2.value=countdownfrom+1 <br>
function countredirect(){ <br>
if (currentsecond!=1){ <br>
currentsecond-=1 <br>
document.redirect.redirect2.value=currentsecond <br>
} <br>
else{ <br>
window.location=targetURL <br>
return <br>
} <br>
setTimeout("countredirect()",1000) <br>
} <br>
countredirect() <br>
//--> <br>
</script></center> <br>
</body> <br>
</html><br>
&nbsp;</p>



19
mramsey
Re:JOB MODULES...or hack ?
  • 2005/2/17 2:57

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


Hello all,

The job listing module is great and this makes everything easier to browse, but what about if anyone with good knowledge of PHP there can crate an advanced search for this module.

Something looks like this one.

<img border="0" src="http://www.coptictheology.com/test/job_search.gif">

Cheers,
Many Thanks



20
mramsey
Help with searchform.php
  • 2004/3/4 5:40

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


I need some help with "searchform.php" include/searchform.php.

I want to find an easy way to change the "Search in" area to a better look other than all mixed, for ex;

[] Module 1 [] Module 2
[] Module 3 [] Module 4
[] Module 5 [] Module 6
[] Module 7 [] Module 8

Anyone can help!!

Thanks




TopTop
« 1 (2) 3 »



Login

Who's Online

291 user(s) are online (192 user(s) are browsing Support Forums)


Members: 0


Guests: 291


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits