PDA

View Full Version : How to create your own custom modules (CMPS 2.0 RC2)


Pages : 1 [2]

Arkham
09-03-2008, 07:45 PM
One thing that confuses me is how to add something that will run consistency through a few different pages, on its own in the "middle", while still running within vB/vBadvanced with the side/outer structure.

What I've been able to gather so far is that vBA can run custom code on singe pages, but is it possible (any examples?) of PHP code running deeper than only one page? E.G. I want to run a new script off of its own db within the content area of the site (middle column, basically) but still have vB/vBA running the rest of the page.

Is this possible? Can anyone offer any examples or suggestions?

Thx!

KW802
09-03-2008, 11:15 PM
Arkham, have you gone through the manual about integrating other pages?

Our Sponsors
 

raining123
09-13-2008, 11:35 PM
I have a code like this:
<TABLE cellSpacing=0 cellPadding=0 border=0 width="182">
<TBODY>
<TR>
<TD vAlign=top width=220>
<TABLE cellSpacing=0 cellPadding=0 width=180 border=0>
<TBODY>
<TR>
<TD class=cActive id=cHoSTC align=middle width=58
height=20 alt=""><A class=Active id=aHoSTC
onclick=switchActive(0);
href="http://www.vnexpress.net/User/ck/hcms/HCMStockSmall.asp"
target=ifrmContent>HoSTC</A></TD>
<TD class=cNoActive id=cHaSTC align=middle width=58
height=20 alt=""><A class=NoActive id=aHaSTC
onclick=switchActive(1);
href="http://www.vnexpress.net/User/ck/hns/HNStockSmall.asp"
target=ifrmContent>HaSTC</A></TD>
</TR></TBODY></TABLE>
<TABLE class=tbHeader cellSpacing=1 cellPadding=1 width=180
border=0>
<TBODY>
<TR align=middle>
<TD class=cHeader align=middle width=38 rowSpan=2>Mã
CK</TD>
<TD class=cHeader align=middle width=38 rowSpan=2>TC</TD>
<TD class=cHeader noWrap align=middle width=70
colSpan=2>Khớp lệnh</TD>
<TD class=cHeader align=middle width=52
rowSpan=2>+/-</TD></TR>
<TR>
<TD class=cHeaderN align=middle width=35>Giá</TD>
<TD class=cHeaderN align=middle
width=35>KL</TD></TR></TBODY></TABLE><IFRAME id=ifrmContent
border=false name=ifrmContent
src="http://www.vnexpress.net/User/ck/hns/HNStockSmall.asp"
frameBorder=0 noResize width=180 scrolling=no
height=305></IFRAME>

</TD></TR></TBODY></TABLE>



</TD></TR></TBODY></TABLE>
<STYLE type=text/css>.cActive {
FONT-WEIGHT: bold; FONT-SIZE: 11px; BACKGROUND-IMAGE: url('http://www.vnexpress.net/User/ck/Source/images/bg_active.gif'); COLOR: #9e224d; FONT-FAMILY: Tahoma, "Times New Roman"; TEXT-DECORATION: none
}
.cNoActive {
FONT-WEIGHT: normal; FONT-SIZE: 11px; BACKGROUND-IMAGE: url('http://www.vnexpress.net/User/ck/Source/images/bg_noactive.gif'); COLOR: #009140; FONT-FAMILY: Tahoma, "Times New Roman"; TEXT-DECORATION: none
}
.tbHeader {
BORDER-RIGHT: #666666 1px solid; BORDER-LEFT: #666666 1px solid
}
.cHeader {
FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #ffffff; FONT-FAMILY: Tahoma, "Times New Roman"; BACKGROUND-COLOR: #9e224d
}
.cHeaderN {
FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #ffffff; FONT-FAMILY: Tahoma, "Times New Roman"; BACKGROUND-COLOR: #af637d
}
.Active {
FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: pointer; COLOR: #9e224d; FONT-FAMILY: Tahoma, "Times New Roman"; TEXT-DECORATION: none
}
.NoActive {
FONT-WEIGHT: normal; FONT-SIZE: 12px; CURSOR: pointer; COLOR: #009140; FONT-FAMILY: Tahoma, "Times New Roman"; TEXT-DECORATION: none
}
</STYLE>

<SCRIPT language=javascript>
function switchActive(i){
if(i == 0){
document.getElementById('cHoSTC').className = 'cActive';
document.getElementById('cHaSTC').className = 'cNoActive';
document.getElementById('aHoSTC').className = 'Active';
document.getElementById('aHaSTC').className = 'NoActive';
}
else{
document.getElementById('cHoSTC').className = 'cNoActive';
document.getElementById('cHaSTC').className = 'cActive';
document.getElementById('aHoSTC').className = 'NoActive';
document.getElementById('aHaSTC').className = 'Active';
}
}
</SCRIPT>


I'd like to make it as a module in the left column. I saved this code as a php file and add a module by this php file. It's appeared but it stretched full of the width of the screen. Please help me on this. Thanks!

Wormy!
11-07-2008, 04:03 PM
Hmmm... when I go t save the new module, I receive the following error:

You already have a Module with an identifier of ''. Please select a different identifier.

Any thoughts?

Our Sponsors
 

Wormy!
11-08-2008, 03:07 AM
I have followed the 'tutorial' at the start of this thread to the letter...

Here's what happens...

When I am 'editing the module' and I click on 'Preview', I get the preview!

When I go to my home page, the new module is missing?

What am I doing wrong?

Thanks in advance!

LCN2007
05-06-2009, 01:40 AM
Can we run Java in a custom module?

Im trying to figure out how to do that in this thread: http://www.vbadvanced.com/forum/showthread.php?t=34857 if someone could help me please

CareyCrew
05-06-2009, 08:42 AM
Can we run Java in a custom module?

Im trying to figure out how to do that in this thread: http://www.vbadvanced.com/forum/showthread.php?t=34857 if someone could help me please


Javascript? Yes ,read post 41 in this thread.

There is a slide show module here : http://www.vbadvanced.com/forum/showthread.php?t=32193

LCN2007
05-06-2009, 01:31 PM
Javascript? Yes ,read post 41 in this thread.

There is a slide show module here : http://www.vbadvanced.com/forum/showthread.php?t=32193

I tried what it said in post #41 it doesnt work for me.

I have thought about FPSS but from what i couldnt find the stand alone version.

Plus the cost i dont want to pay if i can get rocketwerks one to work.

FPSS=$30
RWSS=Free

Maybe you could help me figure out how to use the rocketwerks slide show on VBA? http://www.rocketwerx.com/products/rokslideshow/documentation

AlphaNation
06-03-2009, 07:06 PM
Is the debug mode method of adding customized module options the "right" way to go about it?
When you open a .module file in a text editor, all of the options you'd see in the CMPS Edit Module screen are listed in a strange notation like this one from the recentthreads module that comes with VBA CMPS:

";s:8:"settings";a:25:{s:25:"portal_threads_showrating";a:9:{s:7:"varname";s:25:"portal_threads_showrating";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"200";s:9:"serialize";s:1:"0";s:5:"title";s:19:"Show Thread Ratings";s:11:"description";s:51:"Turn this option on to display the thread's rating.";}s:25:"portal_threads_stickyicon";a:9:{s:7:"varname";s:25:"portal_threads_stickyicon";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"0";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"210";s:9:"serialize";s:1:"0";s:5:"title";s:16:"Show Sticky Icon";s:11:"description";s:127:"Turn this option on if you would like to display the 'sticky' icon next to threads that have been marked as &quot;sticky&quot;.";}s:24:"portal_threads_multipage";a:9:{s:7:"varname";s:24:"portal_threads_multipage";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"0";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"220";s:9:"serialize";s:1:"0";s:5:"title";s:28:"Show Multi-Page Thread Links";s:11:"description";s:101:"Turn this option on to show a link to each individual page for threads that have span multiple pages.";}s:28:"portal_threads_showpaperclip";a:9:{s:7:"varname";s:28:"portal_threads_showpaperclip";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"230";s:9:"serialize";s:1:"0";s:5:"title";s:25:"Show Attachment Paperclip";s:11:"description";s:104:"Turn this option on to display the small 'paperclip' icon showing the number of attachments in a thread.";}s:27:"portal_threads_newpostarrow";a:9:{s:7:"varname";s:27:"portal_threads_newpostarrow";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"240";s:9:"serialize";s:1:"0";s:5:"title";s:19:"Show New Post Arrow";s:11:"description";s:119:"Turn this option on to display the "New Post" icon to allow users to go stright to the first unread post in the thread.";}s:21:"portal_threads_prefix";a:9:{s:7:"varname";s:21:"portal_threads_prefix";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"0";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"250";s:9:"serialize";s:1:"0";s:5:"title";s:11:"Show Prefix";s:11:"description";s:111:"Turn this option on if you would like to display the thread's prefix. Note this only works with vBulletin 3.7+.";}s:23:"portal_threads_lastpost";a:9:{s:7:"varname";s:23:"portal_threads_lastpost";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"150";s:9:"serialize";s:1:"0";s:5:"title";s:19:"Show Last Post Info";s:11:"description";s:82:"This option will display the last poster and time at which the last post was made.";}s:24:"portal_threads_showforum";a:9:{s:7:"varname";s:24:"portal_threads_showforum";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"0";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"160";s:9:"serialize";s:1:"0";s:5:"title";s:10:"Show Forum";s:11:"description";s:91:"Turn this option on to display the name of and link to the forum that the post was made in.";}s:26:"portal_threads_showpreview";a:9:{s:7:"varname";s:26:"portal_threads_showpreview";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"170";s:9:"serialize";s:1:"0";s:5:"title";s:23:"Show Preview of Threads";s:11:"description";s:124:"Turn this option on to show a preview of the first post in the thread when you hold your mouse over the title of the thread.";}s:23:"portal_threads_showicon";a:9:{s:7:"varname";s:23:"portal_threads_showicon";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"180";s:9:"serialize";s:1:"0";s:5:"title";s:17:"Show Thread Icons";s:11:"description";s:73:"Turn this option on to display the icon that was selected for the thread.";}s:29:"portal_threads_showsubscribed";a:9:{s:7:"varname";s:29:"portal_threads_showsubscribed";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"190";s:9:"serialize";s:1:"0";s:5:"title";s:20:"Show Subscribed Icon";s:11:"description";s:114:"Turn this option on to display a 'subscribed' icon next to the thread title if a user is subscribed to the thread.";}s:22:"portal_threads_replies";a:9:{s:7:"varname";s:22:"portal_threads_replies";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"140";s:9:"serialize";s:1:"0";s:5:"title";s:22:"Show Number of Replies";s:11:"description";s:65:"Turn this option on to display the number of replies to a thread.";}s:20:"portal_threads_views";a:9:{s:7:"varname";s:20:"portal_threads_views";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"130";s:9:"serialize";s:1:"0";s:5:"title";s:20:"Show Number of Views";s:11:"description";s:78:"Turn this option on to display the number of times the thread has been viewed.";}s:23:"portal_threads_showdate";a:9:{s:7:"varname";s:23:"portal_threads_showdate";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"120";s:9:"serialize";s:1:"0";s:5:"title";s:16:"Show Date & Time";s:11:"description";s:47:"Shows the time and date the thread was created.";}s:28:"portal_threads_threadstarter";a:9:{s:7:"varname";s:28:"portal_threads_threadstarter";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"110";s:9:"serialize";s:1:"0";s:5:"title";s:19:"Show Thread Starter";s:11:"description";s:89:"Turn this option on to display the thread starter's username and a link to their profile.";}s:23:"portal_applypermissions";a:9:{s:7:"varname";s:23:"portal_applypermissions";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"1";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:5:"yesno";s:12:"displayorder";s:3:"100";s:9:"serialize";s:1:"0";s:5:"title";s:23:"Apply Forum Permissions";s:11:"description";s:125:"Turn this option on to take your forum permissions into account and only show threads which the user has permission to view. ";}s:23:"portal_threads_expanded";a:9:{s:7:"varname";s:23:"portal_threads_expanded";s:10:"grouptitle";s:24:"adv_portal_latestthreads";s:5:"value";s:1:"2";s:12:"defaultvalue";s:0:"";s:10:"optioncode";s:760:"<div class=\"smallfont\">
<input name=\"$name\" id=\"$setting[varname]_0\" type=\"radio\" " . $jsdefault_onchange . " " . iif($setting[value] == 0, 'checked=\"checked\"'). " value=\"0\" tabindex=\"1\"><label for=\"$setting[varname]_0\">$vbphrase[lean]</label><br />
<input name=\"$name\" id=\"$setting[varname]_1\" type=\"radio\" " . $jsdefault_onchange . " " . iif($setting[value] == 1, 'checked=\"checked\"'). " value=\"1\" tabindex=\"1\"><label for=\"$setting[varname]_1\">$vbphrase[expanded]</label><br />
<input name=\"$name\" id=\"$setting[varname]_2\" type=\"radio\" " . $jsdefault_onchange . " " . iif($setting[value] == 2, 'checked=\"checked\"'). " value=\"2\" tabindex=\"1\"><label for=\"$setting[varname]_2\">$vbphrase[dynamic]</label>


How do you go about making a description and selection for your customized settings in the Edit Module page for custom modules?

albokid2468
11-20-2010, 07:56 PM
This was perfect, thanks!

Any way to make a background for it?
It a plain white on my page, and my forum is orange and black, it looks very bad, lol.

djrino
01-03-2011, 04:05 PM
jim6763nva

i have tried to change the weather.module to put my code

but it not works.. i edit it wit dreamweawer..

is there any way to save at .module?

Brian
01-06-2011, 12:06 PM
You should not try to edit a .module file directly. If you want to change something, upload the .module file through the 'Upload/Download Module' link and then make your changes to the PHP file or templates that are added afterward.

siphon
02-15-2012, 01:39 PM
is there an update to 4.0 for this guide? Currently doesnt work in the newer version.