|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////* A; ]) q) ?. \4 P0 t# }. ~
// Theme Option X1 E: J7 y4 W( m% |: W& J2 y
////////////////////////////////////////////////////////////////////////////////$ U+ S: K7 o& B0 c$ w
$ V/ q% ~8 T9 d$themename = "Zenx";
7 j) a" _8 s7 G* s+ G5 i5 V$shortname = str_replace(' ', '_', strtolower($themename));1 V6 u& c+ Z: w3 x7 E" P g
, U2 U3 o- l+ C- {5 O0 Cfunction get_theme_option($option) H& S1 t7 Z7 O
{
. H6 h+ R( `% N( k& s! l global $shortname;2 A4 W9 ^+ H" q, w" B
return stripslashes(get_option($shortname . '_' . $option));
$ |! A, b) o' m/ A$ K8 c}1 C# X ~+ x/ |% ~
5 {1 I! z- f1 @" {- R
function get_theme_settings($option)* D* @1 X3 r- H2 M3 E [+ `* Q1 |2 E
{5 d* \+ p0 o. e! k
return stripslashes(get_option($option));
% f" n( Q2 U1 D% J. t. h}
2 D( f% x. S* V' \ m# T+ X8 D$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");: O$ T! \$ L& j) l( o) Y
$wp_getcat = array();
1 i2 f" D0 f& U) A0 r8 hforeach ($wp_dropdown_rd_admin as $category_list) {
' K3 t: a* S; s$ W$wp_getcat[$category_list->term_id] = $category_list->name;$ h) y" k N# S* h" {, N% a# r; j( y
}( I& G; z! c# M) Q- U
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");3 h. _/ |$ ~7 C5 @
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");4 Q, p. z2 Z2 t# g& N7 g( [
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");% U6 h' q0 z- F8 w- F; | L
# L, N4 s# {7 i& \$options = array (6 i1 k3 _7 N, {5 O
. p8 \* B" A0 t; a- M
, K5 O/ q. {3 ? array( "name" => "Blog Header Settings",8 E0 b# G& ]1 e! d
"type" => "heading",
' j) l2 ]1 ?' X& N W ),
8 Z; t) U& ^ @7 C8 p1 p! l! l9 N2 p) j
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) G' d( q6 q" k" \3 z! X "id" => $shortname."_header_logo_activate",9 |+ |" Y: a; z+ i; j! r0 `
"type" => "select",: C9 I" x, C+ d" S% a
"std" => "No",$ i# O1 R, Y3 ^; a4 C* `, R
"options" => array("No", "Yes")),/ h$ C; L& G4 W/ q1 k) F/ e+ K6 a
6 e. ]$ V( T- _ h0 q array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",2 m! C1 C* Y6 k( `8 {
"id" => $shortname."_logo_url",
5 a& W/ c* ]9 k' H "type" => "text",
# x# g7 q2 `* s( t1 Y; B ` "box" => "social",
' _- Y1 Q; K+ r# C "std" => "",* x e# R* D, ?( B% T
),
2 T0 V0 R1 R+ P , ^8 t/ v- i$ w5 B( `6 ]& v4 O
array( "name" => "Insert Header Banner HTML Code (Header)
8 }% R g* ?( u, h# L <br /><em>*Recommended Size 468 x 60</em>$ J) R+ N! X8 h& d
<br /><em>*leave blank if not use</em>",
( O8 ?1 Y) c' m2 T1 e" G "id" => $shortname."_header_banner",0 Z9 o8 D) r3 O* l" [9 |( Y
"type" => "textarea",
* K0 y, ~: B8 G' j9 h2 l "std" => "",8 Q! e# @# e; P+ h/ O9 B p
),
# I, E. b! M8 l0 q o2 u, t/ J) |7 Q+ B: A' i# R, G+ e
array( "name" => "</div></div>",
% _1 b! h. t1 C. H# _: p' W "type" => "close",
2 }5 S9 B* ]: J5 R ),: @) X, r4 k; C* p. c$ u
/ {1 _0 _% |9 k |
. X% O6 f# L3 ^8 l3 Y. p array( "name" => "Header Navigation Settings",
7 @6 }% G) R9 k, S3 n% I "type" => "heading",
$ N+ f2 \* y4 z% [8 t ),
! |3 M' c2 L* R, \1 b, b% `$ S* o- k D9 ?& z0 U
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />' O( q8 y8 I ^* g. a
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />/ S% B3 H. W/ ] D! y$ M [
<em>*Enter the page post ID number only</em><br />0 V6 H- a9 K$ {7 M
<em>*separate by comma</em><br />
6 S/ p$ V; t- D/ i: G1 c <em>*Exclude pages which you don't want to show on the header navigation</em>",& C* f2 D( ^3 o1 w4 c8 \
"id" => $shortname."_header_page_navigation",
, W2 B4 ` c5 h7 F- K- W "type" => "text",/ w3 J, s& K% D' i/ J
"std" => "",
; \% s2 b* B6 W: K1 W0 a ),5 h4 k8 X8 g2 i8 M" o9 V
% }4 [) S' l$ Z0 V array( "name" => "</div></div>",
6 C* o, I2 L7 Z "type" => "close",
( l# Y$ r$ P) k: } ),
0 @1 H- n5 a( F8 S, N3 r2 U: _ ( F* o0 C; L6 H3 X! T
" v: j" p. _! o2 ~+ x
array( "name" => "Post Auto Thumbnails Settings",2 C: f9 Q' S2 P5 o% w- l+ M# @. E1 g
"type" => "heading",! K) a" ~) p' j. z% i* B
),+ s+ }- X9 k: H4 O2 I4 |
1 k, `" s# L, m& G, r array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
( g+ |/ i' q E "id" => $shortname."_timthumb_activate",4 X F9 N. _2 Y+ O" i+ D2 ^1 `
"type" => "select",
4 f8 G/ I; Y5 g, h "std" => "No",
/ j8 A9 Q8 t B "options" => array("No", "Yes")),
, B9 I) w( w; d" l* a* x) R ( R4 l& \% e. G
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
' z/ W* Z% @# L: [; ]! L/ B "id" => $shortname."_timthumb_cropping",8 R" X4 h6 H9 Q0 V
"type" => "select",/ g4 |. a" Q4 Z& U o7 w8 Z C
"std" => "",4 [# L8 d' N" G3 ?* u9 y
"options" => $crop_position),
1 Q3 A# @2 |/ w) u: J l6 n4 _3 b9 ?( P- M, ]* k1 ?6 d
array( "name" => "Insert Width Of Thumbnail Image<br />
- M. \, V; `8 j0 S5 w <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
/ S( A2 ^. h4 y! E# L; E; C <em>*Leave Blank To Use Default: 250</em><br />",, y2 K L- o/ j. }
"id" => $shortname."_thumb_width",+ S. s- t& J/ A. i$ |
"type" => "text",
" P! f8 c* ]1 O "std" => "",2 [* A# N/ O' f
),
0 k3 k( Z: {: V& T1 {/ L3 W! [! V$ t4 Q+ v, s
array( "name" => "Insert Height Of Thumbnail Image<br />
3 R( D4 F% S' D4 [ z# _ <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
. G( m- c3 R1 f% w6 n! {3 D9 E <em>*Leave Blank To Use Default: 200</em><br />",8 i. y# [9 [3 f) |
"id" => $shortname."_thumb_height",3 M& I" W$ d. S* t9 ?+ d" u
"type" => "text",2 [+ c% A |# b! o% w
"std" => "",, W$ V' ~ I( B
),
: h' J$ p {1 [( F- r# F) r
8 k9 c# S6 U) T7 r6 j/ M array( "name" => "</div></div>",
- d Z1 [( k4 ^5 a "type" => "close",: m3 @) f. [3 D1 [2 b6 H6 l" E
),
+ R3 s8 l% N( g# G7 |
0 E* w$ G) `' G0 V- q array( "name" => "Featured Content Slider Settings",
) S5 I u4 \4 v1 B* j3 j. o" r6 e: F) e* g "type" => "heading",
, B/ g: o" V" ]+ V1 z8 U% u ),. Y" t0 N7 z+ b! K- R
6 _& O. Q$ g9 [/ D; {
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",5 R$ L: X7 H) m Z2 J
"id" => $shortname."_featured_activate",
3 W+ {) I2 M1 R% C% d2 [ "type" => "select",
, w, f4 v% G' A! M$ ~1 p6 X "std" => "No",
9 M4 }1 D/ J6 c" w- j! B! l" _ "options" => array("No", "Yes")),
% N; G) _8 i7 C! ?" r+ N
$ Z! i2 u8 X/ F7 k
4 `$ W$ O* ^- ~( R9 l, |, N array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",) g+ q T& x# f1 C
"id" => $shortname."_featured_category",
0 a+ V/ ^# `" x4 V8 l: J9 M9 U "type" => "select",
. H# x! m m8 x! @( y; C7 l5 h "std" => "Choose a category:",& P' V5 A, v. R2 ]) x8 v0 n
"options" => $wp_getcat),! @" N+ i1 W, v8 Q: u. W' x) d
$ \/ D1 A" P3 \+ l# E' K" K% x) } array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
4 I2 a4 F* n! U7 W "id" => $shortname."_featured_number",6 {; b% u% k6 Y+ a+ V s. {* j
"type" => "select",( Q. j2 m" W) f L+ I' f
"std" => "Number of post:",
; f: h: Y( N" e D" F+ E; L: K "options" => $number_entries),4 v" Y' P/ A6 X) D; k
- T6 j8 N @5 {. C9 J array( "name" => "</div></div>",
. {4 S, K& j3 A! T5 K# F "type" => "close",
3 |3 f8 d- W% Z; \: W- Y3 D ),9 [2 r5 p4 @; Q+ p2 Z" v% A
4 w6 ?3 O2 |# z) \$ G& o1 D% z, r array( "name" => "Featured Category Settings",& e y o# u- B0 C/ w1 b! {+ U9 V
"type" => "heading",0 g$ o2 F: |( p% L9 I8 s9 o
),
9 a4 {" X& h/ V9 P$ l# F' {5 l4 q
6 Z- g. A) y- ?, B8 P' K array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",2 K% Q3 E' E6 H
"id" => $shortname."_featured_category_activate",3 Y6 m Z- N7 }
"type" => "select",
8 m' Z+ \. r1 d" W "std" => "No", d0 d. W3 E2 ?/ d3 A8 o0 I" a# w
"options" => array("No", "Yes")),, c: J6 [4 r0 i# L
5 \% [& J" B' ~2 Z array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
% `$ `! c3 K. y "id" => $shortname."_featured_category_id1",
( F. q3 l p+ R$ } "type" => "select",/ C& q0 [9 _% c9 C6 @; Y5 ?
"std" => "Choose a category:",
% P: u! N9 F; I |' w- R# ?& U3 _ "options" => $wp_getcat),( g3 y5 ~3 N1 `
6 ~$ ` N$ X6 ]% t& u) a; h array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
g! d% O5 L) p: a' k4 J- P "id" => $shortname."_featured_number1",
: d/ C! u% F J* p; C' ` "type" => "select",
9 x7 F0 d0 {( Q8 B/ Y# @5 a6 n3 b; w- A# [ "std" => "Number of post:",
7 F) W7 Q5 @. [3 o7 h d5 w "options" => $number_entries),
6 U' w# w& {2 k S, X, |) A) K8 @0 }8 {, w: u+ ^
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
& W& p% A5 H5 v u/ p$ u$ { "id" => $shortname."_featured_category_id2",# S/ `1 e: F5 G
"type" => "select",. t3 y) L5 J0 w
"std" => "Choose a category:",7 F' c% U- L' M
"options" => $wp_getcat),
) o# p* _' Y$ k$ p+ c5 v5 m' N, S7 y - _1 a: `% o! T1 C
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>", j8 Z* d, L" \( ?/ H' d% p5 q% @% D
"id" => $shortname."_featured_number2",9 I$ T1 ^- S% f
"type" => "select",6 n+ [( |, N Z, g# j
"std" => "Number of post:",
; _' h; O, Y5 G% h, p "options" => $number_entries),
+ _! ]0 b j% P$ t
/ K" H; j0 V4 ?& X/ o; v
' X3 l6 j; V3 Y5 n! q1 F array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",1 _: G U! x( R/ H& S
"id" => $shortname."_featured_category_id3",
+ X! R- d4 r# Y( G "type" => "select",
4 V) V+ \; s' ]9 P1 K# R; z "std" => "Choose a category:",, M" I* N1 I4 P3 l) K6 Y& ^4 R
"options" => $wp_getcat),& `% j: H9 c' T9 H4 e8 i3 Q8 M
* {" {0 J2 Y& W* K3 X array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",( s+ L1 `/ B2 ~; U* C4 L! x$ _, t" p
"id" => $shortname."_featured_number3",
' A8 _9 K9 |) x# K "type" => "select",
& N9 t, I6 Y0 G "std" => "Number of post:",4 w6 y0 v- A: R9 O" k3 W
"options" => $number_entries),, i; ~0 ?" s! i, ^" |
- H! m9 E4 K- J& T2 `% `$ ?+ o `
2 O' L' w4 ~6 } L2 M- |6 Y array( "name" => "</div></div>",4 }5 j* M9 I% G, e2 d$ M6 U5 O
"type" => "close",
2 P3 B2 r' b/ [/ j ),7 [/ U" |- ^% I. a# {% L' r
5 t$ C, n; g2 V9 S+ e8 E @
# h, h3 @ T. d ?' g
array( "name" => "Google Adsense & Analytics Settings",3 t. Q( _; V; j5 @$ t; f
"type" => "heading",
7 e: G/ o; H" @4 R ),
8 h' U9 Z2 h9 T Y( J# U$ z7 O7 ]: Q2 |; D6 i
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",8 g; y4 Q' w- H' N+ q. w
"id" => $shortname."_adsense_loop_activate",/ _$ ?1 W, f, V# q, q
"type" => "select",4 W* F" ~1 l4 ]8 N- _* `9 u
"std" => "Disable",
. [: A- ?+ ^ e% b: _- u/ c) a* l+ M "options" => array("Disable", "Enable")),
0 A0 o7 L! ?$ ]/ N
0 `4 t& m k f% u$ d array( "name" => "Insert Google Adsense Code For Loops Here<br /># d7 q+ y3 r$ R5 N# _8 x% I, W
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
; z" K# {9 ]% |6 J- s "id" => $shortname."_adsense_loop",
6 p% ^( z) S: z/ } "type" => "textarea",- Z7 x( R6 H" n1 m; h
"std" => "",2 j7 Y" \9 |) a) J6 A4 w, B
),
/ Z% Q+ D1 J& T9 A1 \
& J1 T% {2 S8 T" A2 U7 I array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
5 o1 n/ ^1 L! U: i "id" => $shortname."_adsense_single_activate",8 ?# e* s8 e2 y( I1 X4 `
"type" => "select",) L! p6 ~- [. L; X
"std" => "Disable",; }, U& j- J4 I) l1 U% _
"options" => array("Disable", "Enable")),: f8 d; S( S/ x: a' m8 ]; k0 m
; l7 ^ `2 k. A) f7 S2 N* }
array( "name" => "Insert Google Adsense Code For Single Page Here<br />; |1 X+ C( V0 i' F; S3 r; j
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",( M J9 h! C8 U
"id" => $shortname."_adsense_single",
. a! j/ q4 s: K" D "type" => "textarea",$ Z! p1 K" f/ D n: I% o
"std" => "",8 w3 q# D0 O- B+ U
),
- h/ O/ O) i& U- W9 L( R" C
) O* G7 X% o' h- K+ i6 c1 c/ v
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
& |$ q. U& N: l3 U" c6 B" ?3 V7 ^ "id" => $shortname."_google_analytics",
5 y* i7 J; U: o1 B/ c- g2 s2 J "type" => "textarea",& N# w; q( C+ I' C. _, L8 S* y/ G
"std" => "",
* v6 N! G, m9 _' e& F: ~ ),
# k5 h) o; l; E; F; C1 c% f$ k9 A& z' R: d! i; n5 s
array( "name" => "</div></div>",
, g* }7 M$ t' n; f "type" => "close",) i- d# e2 \! [8 N5 X
),! m P# P1 `, ]) f: j
$ s+ G" |. w' |3 J4 n% U+ m4 r% o
: k* i% {# Z/ W2 n' o/ n1 _ array( "name" => "AddThis Social Bookmarking Settings",
2 m; e8 ]8 W/ ^. D4 o0 Q "type" => "heading",
8 c, E* ^, H3 E8 L8 P6 [ ),
# S6 ?- d* {9 Z1 O( a$ b3 _9 H' w4 J* c% h. c& D0 i* K
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
8 f3 o8 V+ z6 F2 z <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",3 j1 g2 q7 H. Y
"id" => $shortname."_addthis",
+ ^& T7 z% C% D' Q; [& r: a Y "type" => "text",
0 P1 N% ~; F( L "box" => "social",
) w1 j( N+ }3 x: I7 l6 Y- m4 U "std" => "",0 \* C% U' X2 J
),
" @+ z' J7 ^. Z5 ]0 G2 X# B9 a' G- _6 z. S; B6 t1 b) ~& Q3 U9 i
array( "name" => "</div></div>",/ K% u7 a* n1 ~) J
"type" => "close",* A/ z9 {' W' I8 y" @
),, M+ Q) ^& T7 b6 Z- Q
5 o1 p# f2 k K( C
1 ?" J6 D/ X0 }& Y9 ~/ E5 X D $ ?/ i! Z& b j j \3 }9 f
array( "name" => "YouTube Video Settings",
4 Q9 `0 F: ]+ q$ w# s "type" => "heading",4 x% L; c7 s4 m
),
4 u0 f6 [& k) D6 O9 Z- ?5 V+ \8 F3 `- j! [$ x- n
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) g' L4 \" o' c4 @( _( A" O
"id" => $shortname."_emvideo_activate",# k/ j: Q0 f# a
"type" => "select",
/ z% n0 V% p- U( }( ?! Z" R "std" => "No"," j* p+ {' W8 M# |' |6 S; h
"options" => array("No", "Yes")),6 G$ i) Y7 C: o! X2 Z& g& O
. R L9 V8 K% N+ }, B9 K# W array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>"," T R4 E7 a3 G+ R L' u$ U
"id" => $shortname."_emvideo",/ d2 n, _3 k: W( h! P7 D
"std" => "",
" v% A# s& }/ N; N/ g* b% g4 I7 ]2 k "type" => "text"),
U+ b+ s8 w; R& U' y
: @0 X4 \+ a, Q! Y$ p+ F/ N array( "name" => "</div></div>",
# c' _) c1 k, N4 ` "type" => "close",
6 A: L B% |) x( v ),
+ q# e( B+ a) l2 r; @5 D/ d ! K4 I; D% ^# M* B3 Y3 a
array( "name" => "Twitter Settings",
+ q, x) W0 M# d9 z6 a' C "type" => "heading",
" G# _8 T: a' V2 ?3 ] ),9 r8 g) |! M# S4 h/ ^# v8 l+ t
) W& |) w1 H: W7 R0 g array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",+ I8 n. [3 o: [7 ]! Q4 o: ~
"id" => $shortname."_twitter_activate",
3 |8 L) N# b; }2 `# G "type" => "select",; ?( |; F- l* i- U e2 D
"std" => "No",
4 C% j4 Z) ~, o+ N4 c "options" => array("No", "Yes")),$ L- t/ m9 x. w1 Z7 S
) V6 A4 B/ `! E& Z
array( "name" => "Insert Your Twitter ID here
+ W( Y6 `" d) F# X$ q0 @ <br /><em>*leave blank if not necessary</em>4 R( ~4 ?; n0 v( u* @ [
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",( ~' S' A% u+ z2 Y8 F* _
"id" => $shortname."_twitter",
/ W ^/ g9 \5 S% O8 q5 K( m% Q "type" => "text",
# ^3 P1 I+ C* A "box" => "social",2 z4 h7 G# s' q- p
"std" => "",
- M4 R v- ^5 A6 r$ S6 p ),1 ~' V0 j* r: K1 r# J6 t) {5 ~
9 e) X' P6 w5 x$ D/ d, Z. I2 n% t& B
array( "name" => "Enter Twitter Feed Count here
) @* s1 D: j' a. m <br /><em>*leave blank if not necessary</em>
- y" \* m( t. k: ?7 ^4 L: N <br /><em>*Enter How Many Twitter Feed To Display</em>",
9 o/ I* V3 B) v. \' ]9 N1 K8 b* Q' T/ [ "id" => $shortname."_twitter_count",) M/ n) C! t; w+ O% { z& o
"type" => "text",
( m7 n3 c2 P% w( i2 a; J "box" => "social",
2 V$ Q+ m1 k" V "std" => "",
) j( O7 I/ ?. \# U- p3 @) o9 b3 \0 Q ),! t8 M% @. }" Z3 [; I
4 `! Q/ \! N( o' M& B% t0 o! S array( "name" => "</div></div>",: O, {. R$ x) I3 n. G% h8 q
"type" => "close",
$ i7 S& r" [+ R, K/ m8 N" a; y ),
" @7 @+ q: R1 F3 h6 V
! ^1 I5 z% o0 V: y# ]7 K0 M/ M6 Y# y( v6 r& ~' x8 E: c2 [/ ?
array( "name" => "125 x 125 Banners Advertisement Settings",+ w; e7 L( I' d9 N2 e
"type" => "heading",
8 L2 ~+ o7 j1 W ),
& z: w$ l9 Z2 h& E* d! ^: l0 S 7 {9 J2 D' Q- J, q' ?
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",4 t7 [. y. i9 o( ?2 I# Z
"id" => $shortname."_sponsor_activate",
; I+ ^9 @: k; Q, K: P1 g "type" => "select",
6 Z; |) T! j/ J k "std" => "No",6 o2 L8 }6 e+ N; X8 b& m" U
"options" => array("No", "Yes")),/ I- |* }( e2 s2 z' q: E0 B9 _9 E
@7 h- n! o2 ~$ a# y
* H9 ], a6 m y3 S1 U
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
L! y9 N; G, Y "id" => $shortname."_sponsor_banner_one",/ B8 Q5 w3 g+ z. z! P( B3 R C7 f
"type" => "textarea",
* M* w p o6 D* }- c7 G% X "std" => ""," J, @% H I/ F0 {: M& z
), ; N' z5 D$ A, q O8 F
; D$ {( q+ K% M3 L. K5 d
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
: u6 ]" ]8 q' F4 o* z5 t5 Q "id" => $shortname."_sponsor_banner_two",
7 U8 n) w2 T# F "type" => "textarea",/ I6 U1 j! d) X5 N* V+ J; i2 E
"std" => "",
+ {1 M6 x$ G T U2 [ ),& d: c; V9 v5 Y; b" L, K
$ e( p/ r9 n" H9 V) A
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
( P' o; r# g: g; y) V- c5 j1 i "id" => $shortname."_sponsor_banner_three",
; E+ s* K* G# W* U2 v "type" => "textarea",
3 u% I# S" ^' R8 ~ "std" => "",# [8 q; j; J; e0 |" I( y% i
),
: v+ v" n( S; ?
8 L1 ?/ u% g" i Z1 G array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
. l* |8 b8 {% M8 H; _# P0 d "id" => $shortname."_sponsor_banner_four",6 P, `' [) S; L0 ]- f
"type" => "textarea",
% F- R* A+ S( c1 G. @' U5 B1 i, w "std" => "",
; m* ]& Y1 i; [; h ),
: E( f, m+ Q0 e5 }! R. q G1 K+ p; v/ \% s* c& p
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
' [( {. V o. q, {$ [, o# g+ \& S0 X "id" => $shortname."_sponsor_banner_five",- l. |) z1 r9 ~4 \ [7 D. K l
"type" => "textarea",
; @# p$ v# l& u3 p7 S "std" => "",
; `5 ^: b" j0 E7 X' T& R3 O: P% d2 O ),6 p. H5 V% I, m: [6 H) c& v1 ]
) S8 P; }/ M9 C" z8 G
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",2 w% _! q3 p1 _9 z
"id" => $shortname."_sponsor_banner_six",- }% g! t: H d4 }6 n7 M; Q; o' W, I
"type" => "textarea",( r1 t7 D c! R4 B. s* C
"std" => "",
/ [4 ^! D) M5 h; t' u9 Y ),
6 ]1 `. S0 I( a. G% B5 L7 f# X
1 [# ?* I5 B: j" Y array( "name" => "</div></div>",
8 H0 Z2 |% T, o! `) X8 }, M- r "type" => "close",
+ P+ m# ~. I, |4 `$ K! F ),
1 | C0 }* x# i) D) K* i
4 l2 O, I$ \8 ^; J
- K; {) @# M; d: D
+ S# S+ e# D5 b/ @/ u2 K; R3 N);7 d7 }* V- @- d: l! w1 q/ ~
. \4 P8 C+ R! f* j: tfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
5 I. o/ Z2 d% _* S( h0 @# {# N# O6 s& q2 P$ K- A. D
echo "<div id=\"admin-options\"> ";
$ Z7 a/ w5 f% T- @5 n5 B3 g' n
7 g* f8 v9 R* Z" `global $themename, $shortname, $options;) x" c" K# o3 V( O' ]
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';1 V" R3 _# u* X: {
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';( p( n& N5 e: D% ]: e- r
?>$ P& f- j1 z1 k4 c1 q1 Y- e( p" R/ u
3 V6 `) V3 \. }: K) u6 G( Q# I
<h4><?php echo "$themename"; ?> Theme Options</h4>
0 S- P$ K8 g! n8 g, p5 _$ d# ?) R2 w2 \ T- s
<div class="annouce">7 V h6 L7 Q+ n! i( w! J
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>' |: k$ F* ]/ a4 M9 L$ {
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>6 h. ]+ u3 G1 t6 s4 Q0 x
</div>
3 R3 B* R: I' P- Y! ?2 K( q- c. `1 s; x$ n$ |/ N, _8 ?, e; e
<form action="" method="post">7 h; s4 {# r2 f3 [8 r% Q
5 d1 } p2 ?7 d* V0 U* s<?php foreach ($options as $value) { ?>
' w" ~; G1 F f; F- V5 J, g
6 R G. A9 h) Y9 d<?php switch ( $value['type'] ) { case 'heading': ?>
& T/ ]) p% C# s- t
! z0 Z# L3 W. k- L, [5 w<div class="get-option">
7 {* Q3 E n6 |0 p7 m( w1 u" |$ @ w6 s0 H/ m" H$ O) ^- n
<h2><?php echo $value['name']; ?></h2>3 ^% R& x4 ?( k
3 h0 O6 X x6 o<div class="option-save">
: s3 S. H$ _0 u8 s; ?/ m9 m& m
<?php
2 O$ K3 P5 h3 Zbreak;
9 W3 U( i: l& }( q3 r0 ~$ r2 r# E/ S- Acase 'text':+ C ]8 w6 E7 U% v# p% }* ?) x
?>8 {: X) Q3 {0 m+ t7 |
8 f3 a" ]2 P: S# V+ ^& W, m) W5 h0 y% b<div class="description"><?php echo $value['name']; ?></div>
( u" ]/ G1 a+ k8 Z! l<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (5 j$ U- q2 b/ U8 e
* g) I S% K3 a& S1 ?3 F
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
/ |) K0 y. E+ v" {
/ v& o1 D2 S9 J0 D6 }: D$ ?+ k! i<?php+ n, @ Q1 Y. |7 n8 U" \* Q
break;( y3 l; q' M" T4 q- ~6 Q0 D7 |
case 'select':1 k, G" p% U0 w- L
?>0 p8 f, h6 u1 }6 D9 y$ f5 N+ E6 Y# h
7 y! ~7 M1 J/ }$ u/ E<div class="description"><?php echo $value['name']; ?></div>
! X3 K. {+ s2 N1 w( W<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
, V. i8 E' [' S) Y1 p" p<?php foreach ($value['options'] as $option) { ?>1 J9 t1 Q; Y' Z& [, q
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
- d6 c9 \, M( j" I) U8 Q- C<?php } ?>! r0 w _. X0 K6 _ ]: L8 e
</select>
& B0 ~8 g( k) ]' n</p>$ V2 ?7 r% Y* U. c7 X) p5 a' q
0 G5 ~4 B4 o1 N1 o; D<?php& Y Z- J) y! b, B% N
break;
4 ^" V1 b- _' g' wcase 'textarea':
* H; q& }6 m+ @$valuex = $value['id'];# u" ]5 S) v% D
$valuey = stripslashes($valuex);2 H, d) L$ v2 j+ ?/ L
$video_code = get_settings($valuey);
+ b7 _4 _9 v4 ~5 E2 N?>
6 ~- ` \8 L2 [; W- ~
" R& @0 v# w, y7 k* u6 Q<div class="description"><?php echo $value['name']; ?></div>$ d! D- N7 T* H1 E
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
; a+ F( F, D: l3 f3 n- c" _' r# H! k' |8 ]% c
else { echo $value['std']; } ?></textarea></p>
1 g$ U H, j$ o* c& r
4 ^6 W: ?" V6 t1 E, @$ }' F! Z<?php/ u9 t3 T6 F/ |& G2 {# m1 g
break;
( W$ I( o1 C, p2 E Rcase 'close':! Y: H$ G/ D; Y4 u4 _
?>* U0 d9 t+ `/ e& t( J' Y
: M3 A( K6 R. J! ]<div class="clearfix"></div>7 r7 z) P+ z$ k9 n
</div><!-- OPTION SAVE END -->& v# n( \' s2 \3 i6 [9 Z
7 x j5 D. @8 R9 s<div class="clearfix"></div>4 D7 B. y- w6 ]+ \# G2 E% ]8 w
</div><!-- GET OPTION END -->
. ^$ t( G8 W) k
& v* i! f; h: X G# ]0 }<?php
% A7 M6 |0 K6 hbreak;: `/ G6 Z: c' e
default;
7 B. [' r' N. K$ q?>. x2 \" [. g$ {% x) J+ k' s7 e
( q) Y ?5 I* R) [8 y1 ]
1 q% N0 v! R0 r<?php
$ W N- m+ v; Y! h1 R' rbreak; } ?>
7 U h7 }2 l/ w$ V0 j# c1 W" }! ^6 h A7 I
<?php } ?>
Z% v8 T" I: P! W# Q- H% X$ y& l) j n( D$ Z
<p class="save-p">
' S$ q5 m2 Y% k" C<input name="save" type="submit" class="sbutton" value="Save Options" />7 B9 W0 }) V5 S* c( h! @
<input type="hidden" name="action" value="save" />2 j$ z% A- h+ e7 G- u4 f, R
</p>
1 g; k" z" f% U: ?3 u7 C</form>/ K. C. W) S! m/ \% ~; t
; g% B" q/ n# w, y1 j: {" ^
<form method="post">: t6 ~% v: w& e: ~% q
<p class="save-p">
& U6 H4 p: X" ^9 I1 c2 d<input name="reset" type="submit" class="sbutton" value="Reset Options" />
$ s; B9 R' i, G& g- T<input type="hidden" name="action" value="reset" />
. P; u# I! P# q: d r, P8 v z</p>
1 @- z5 B8 k! L4 I# ]</form>/ T- B8 B+ ~8 q0 u2 {. r
/ e f8 n; K! e/ u$ x6 _% T. T</div><!-- ADMIN OPTIONS END -->% I5 v; R$ L7 u: l% L
" k F- e, x" `- U& L
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }% [+ I" q, {7 C, b+ D
$ H* ?0 F. T& c: H& a! k3 W* nfunction mytheme_admin_register() {9 O* I; h+ v* W$ \( p2 Z+ H
global $themename, $shortname, $options;
4 k! t8 i# o7 |/ R0 @4 E) Cif ( $_GET['page'] == basename(__FILE__) ) {
3 C& M0 R6 l9 p* Dif ( 'save' == $_REQUEST['action'] ) {" U. e/ G9 B I( r! v" Z4 s
foreach ($options as $value) {8 ~. n8 N5 S4 t+ `& m
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
2 O7 ~. E/ J& V( W5 D( lforeach ($options as $value) {5 n) h" ?; \& ]) N1 u( f- K/ D
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
' c6 c# i1 o6 _& w' s/ I y, nheader("Location: themes.php?page=functions.php&saved=true");8 Z. ]* H7 u8 W
die;
- Y% f( Q% X7 ?6 A: y} else if( 'reset' == $_REQUEST['action'] ) {
2 \3 o7 C) ]' `$ z1 B ]7 nforeach ($options as $value) {: d' }$ l! S8 J' }) T# t
delete_option( $value['id'] ); }
6 i5 l# K$ ^; W/ t; S+ aheader("Location: themes.php?page=functions.php&reset=true");
7 c7 F d- @& Y8 t9 R; bdie;! s1 [/ r6 c' g. n; a' F
}
* V* L9 W# l, {" @- O}
# U9 O* n( y; d- ?add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');2 V6 G' S* ]5 C
}
. n, z. r; B5 [9 ^. P8 e. t- G! e7 ]( l
2 a# w% q3 s" F6 |function mytheme_admin_head() { ?>
1 l* H7 k. G& y" G# L7 h<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
% K1 i5 W! J& l<?php }3 h3 Z/ S; A; I2 w" E0 h1 j
|
|