CoCreate User Forum  

Go Back   CoCreate User Forum > General > Make Test Posts Here

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-17-2005, 10:26 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Colored LISP in forum

well.. just a try.. but the single quotes (forward-only) are mixing up the PHP highlighter.

PHP Code:
(sd-defdialog 'thread_extension
 :dialog-title (sd-multi-lang-string "Thread Define" :german "Gewinde Def.")
 :after-initialization
 '
(progn
    
(trace oli::sd-define-thread
       oli
::sd-inq-thread
       oli
::sd-destroy-thread
       
)
    (
setf profile nil)
    )
 :
mutual-exclusion '( (nomi-dia nomi-dia-inch) (pitch TPI))
 :variables
 `(
   (t-feedbacks :initial-value nil) ;; all feedbacks shown
   (result      :initial-value nil) ;; saved return value of sd-*-thread functions
   (props       :initial-value nil) ;; cylinder face properties
   (a-cyl-face
    :selection  *sd-cylinder-seltype*
    :title (sd-multi-lang-string "Cyl Face" :german "Zyl. Flaeche")
    :check-function
    #'
(lambda (this-face)
    (if (
sd-cylinder-(SD-INQ-GEO-PROPS this-face))
        :
ok
      
(values :error
          
(sd-multi-lang-string
            
"No cylindrical face selected. Thread Information is only valid for a cylindrical face."
            
:german "Keine Zylinderflaeche gewaehlt. Gewindedefinition nur bei zylindrischen Flaechen moeglich.")
            )))
    :
after-input
    
(let (center axis start radius)
      (
dolist (a-fb t-feedbacks) (sd-end-point-feedback a-fb)) ;; remove old feedback

      
(setf props (sd-inq-geo-props a-cyl-face :dest-space :global))
      (
setf center (sd-cylinder-center    props))  ;; really the center also in axis direction!
      (
setf axis   (sd-cylinder-axis-dir  props))
      (
setf start  (sd-cylinder-start-dir props))  ;; this is for rotaion,
      (
setf radius (sd-cylinder-radius    props))

      (
push ;; center of cylinder
       
(sd-start-direction-feedback
    
:point center :direction axis :disc t  :color 0,0,1)
       
t-feedbacks)

      (
sd-set-variable-status 't-define  :enable t)
      ) ;; end after-input
    ) ;; end a-cylface
   ;; -------------------------------------------------------------------
  ;; direct testing:
  :optional
  :presets 
I tried the HTML vb_code, too. But this made more problems.

What's the way such a higlighter is defined in our forum software? I'm a little bit familiar with generating highlighter files for different (freeware) editors. There does my interest come from..
Reply With Quote
  #2  
Old 10-17-2005, 12:04 PM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Re: Colored LISP in forum

Quote:
Originally Posted by Wolfgang
What's the way such a higlighter is defined in our forum software? I'm a little bit familiar with generating highlighter files for different (freeware) editors. There does my interest come from..
Interesting attempt. I never tried color coding the LISP in the CODE tags. I never thought of trying the PHP tags, but they seem to maintain indents better.

I don't know of any way to do this with the standard vBulletin software, but since it is delivered as PHP source code the hacking possibilities are unlimited. There is an entire website devoted to vBulletin hacking which includes many tested and published customizations at www.vbulletin.org. You might be able to find what you are looking for there.

I prefer to avoid hacking the PHP code since it makes upgrading difficult, but if it is fairly simple I would be willing to consider it. We do have a few simple hacks applied to this forum already.
__________________
John Scheffel
Reply With Quote
  #3  
Old 10-18-2005, 10:52 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Colored LISP in forum

oh I used the PHP several times before (for 2..3 lines only).. but this time it was a test how far it is working.

Well, I already was looking into those support pages for vBulletin software. But since everything of vBulletin software behind the UI of my browser is new for me it will take a while. But I assume there are some ASCII files arround which define a) which vB code are allowed and b) how they will format the included text. So I think it's a more kind of advanced customization than a hack. --- or would you call it a hack of OSDM when editing sd_customize file

But it will take a while... but winter is in front of us, with long dark nights.
Reply With Quote
  #4  
Old 10-18-2005, 02:58 PM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Re: Colored LISP in forum

Quote:
Originally Posted by Wolfgang
But I assume there are some ASCII files arround which define a) which vB code are allowed and b) how they will format the included text. So I think it's a more kind of advanced customization than a hack. --- or would you call it a hack of OSDM when editing sd_customize file
I consider anything which requires modifying one of the PHP source files a hack. We have a couple of simple ones. They are difficult to maintain since everytime that PHP file is updated you need to recreate your modifications in the new file. Some of these files are updated in almost every patch.

Stuff that can be done from the Admin Control panel, such as modifying the templates that define the page appearance, I would call customization. It can still be a pain to maintain if the original templates are modified, but there are some tools to help and this happens less often. We have some of these as well.

The Admin panel does have options for adding and managing custom BB codes, but I have never played with it. It is documented in the vbulletin manual at:

http://www.vbulletin.com/docs/html/

If you have anything you would like to try, let me know.

I searched vbulletin.org for "lisp" and "code AND color" but could not find any examples of how to create color highlighted program code.
__________________
John Scheffel
Reply With Quote
  #5  
Old 10-23-2005, 04:42 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Colored LISP in forum

Thanks for finding out some more information, too.

That documentation decribes only how to add SIMPLE vb_tags which can be converted to HTML by just replacing the opening vb_code with it's HTML tags and same for the closing one.

For the existing PHP and HTML vb_codes the text written between opening and closing vb_tag is parsed (word by word etc.) and depending on some rules the color coding is done. This is really different from the simple vb_codes. - So some more time needed for investigation. - I hesitate to set up a complete webserver for my own incl. PHP and vBulletin stuff.
Reply With Quote
  #6  
Old 10-23-2005, 04:53 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Colored LISP in forum

Just would like to see how PHP does lool like here in our forum:
PHP Code:
/*
this php example was taken from 
http://www.php-scripts.com/php_diary/example24a.phps
*/

srand(time());
  for(
$i 0$i 52$i++)
{
   
$count count($cards);
   
$random = (rand()%$count);
      if(
$cards[$random] == "")
      {
         
$i--;
      }
      else
      {
         
$deck[] = $cards[$random];
         
$cards[$random] = "";
      }
}

srand(time());
$starting_point = (rand()%51);
print(
"Starting point for cut cards is: $starting_point<p>");

// display shuffled cards (EXAMPLE ONLY)
  
for ($index 0$index 52$index++)
{
   if (
$starting_point == 52) { $starting_point 0; }
   print(
"Uncut Point: <strong>$deck[$index]</strong> ");
   print(
"Starting Point: <strong>$deck[$starting_point]</strong><br>");
   
$starting_point++;
  } 
Reply With Quote
  #7  
Old 07-03-2008, 02:32 PM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Colored LISP in forum

[highlight=HTML]
<title>ueberschrift</title>
<body>
<p>bla bla bla <b>bold</b>
</p>
[/highlight]
-----------------------------
[highlight=php]<?php
echo '[b]test';
?>[/highlight]
-----------------------------
caused on the discussions on future of this forum.... I have been searching for vBulletin information once more and stumbled about:But looking to the very last postings there still seemed to be some manually detailed changes needed.... so not really ready for use.. it's a pity.

Last edited by Wolfgang; 07-03-2008 at 02:52 PM. Reason: double post and some BBcode issues..
Reply With Quote
  #8  
Old 01-11-2011, 10:35 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Re: Colored LISP in forum

The post and response about how CoCreate LISP compares to AutoLISP has been moved to a new thread in the Customization forum.

Comparison of CoCreate LISP and AutoLISP
__________________
John Scheffel
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:35 PM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.