|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
* z) t5 K4 o! s// Theme Option8 D2 z) @; W& N. L7 g. a
////////////////////////////////////////////////////////////////////////////////
9 t* I. H* S" J$ `6 ~# b6 o! a1 K# s! c% K5 [: E2 [+ ~9 {1 r0 ~
$themename = "Zenx";' F9 M% w6 {! e" x
$shortname = str_replace(' ', '_', strtolower($themename));9 t8 M7 T8 E& Y1 C6 W
# o5 t( Q2 `6 d K, [) y5 w
function get_theme_option($option)
" ~. ?3 ?4 H- K) |8 D, q/ T) {{
1 G0 ?9 O1 n9 S1 f1 X- n' s global $shortname;; y: X3 D- w2 d$ l2 s# K
return stripslashes(get_option($shortname . '_' . $option));, z$ |* O( b7 j8 j G) E5 g
}
( r8 c; z L Q; a/ E* {' N$ t7 ^; d
function get_theme_settings($option)
+ e1 |1 O( n% z1 U o5 W{
- j) w$ W3 Y; c9 _4 m) B return stripslashes(get_option($option));
! _8 R# N3 Y* f) _7 I4 n}
6 q' n! m* j( F E, |# \3 i% V$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");
+ a. a* d& ]2 T$wp_getcat = array();% E7 K; P# g2 ~! I0 }5 S
foreach ($wp_dropdown_rd_admin as $category_list) {! L$ l2 \" ]3 Y# G! ?, m) r
$wp_getcat[$category_list->term_id] = $category_list->name;
6 F. k9 V: E7 g5 W}' n! D7 }- J" a" N5 y! P
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
- Z" B& \, t) w7 J0 ^$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");5 J6 S. b+ f7 N* Z3 {" ]9 ]: j4 j
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
3 g4 B) v# x( @ Y' _6 Z. {
. P3 ?' W) `5 P+ f% y7 P7 h9 D0 z$options = array ( o# e: m+ t- M, B; c3 b
* l% t6 f6 k2 e6 y" b$ Y
+ v! F6 J: \) Y- }2 ?* i9 J- @ array( "name" => "Blog Header Settings",2 n6 T H4 n( I" ~' F
"type" => "heading",% W* e& e+ e; Z
),9 e4 R! |/ v4 c
) _% y) i& M5 v" J* d- o4 H array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",2 `4 F6 _0 P) W
"id" => $shortname."_header_logo_activate",% N/ T- f, E7 S& v- B0 L
"type" => "select",8 c- d7 R( R \: h7 O9 j0 A7 A
"std" => "No",7 @/ Q, J3 p, `5 _6 D1 H
"options" => array("No", "Yes")),
/ I: T2 S; n" N
# C: k; {; b. e! I @3 [ array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
7 H% [9 ^5 B' N1 R+ f. ]6 b "id" => $shortname."_logo_url",+ N8 U3 |8 p1 \# Y
"type" => "text",
: E% S" U7 Y2 _! i, ~ "box" => "social",4 s( G/ H4 D1 U6 Q# b& \9 J
"std" => "",
' c* s% a/ H! u1 {) D4 B/ h ),
: V w4 {( i& i4 L1 m/ } 6 N B+ X2 s& }1 G/ C+ b2 N- c- M" V6 B
array( "name" => "Insert Header Banner HTML Code (Header)9 s3 y8 V7 B, a( B: s i, B, g1 d
<br /><em>*Recommended Size 468 x 60</em>
* L# P( m/ J, u( u" m <br /><em>*leave blank if not use</em>",
d w- a! B# b% b "id" => $shortname."_header_banner",- P& Q! B6 F4 X9 O p7 |
"type" => "textarea",. ]* e# m) W% B
"std" => "",% D6 E2 Q# ^. M
),
' D. {) k+ F/ z+ K' F7 u2 u' l
, l6 r& {% u7 N: K8 @, f& i array( "name" => "</div></div>",
5 Y. O/ ]- t/ o7 Y4 c$ N "type" => "close",
$ V& x7 C* f9 I ),: B% w, n" `8 ~6 y/ K; O3 M
; @+ }, z2 s( ~
# Q0 J) V0 [' h% ~5 x8 t
array( "name" => "Header Navigation Settings",
. Z. C( @' s9 r( E7 z8 E4 z "type" => "heading",
/ N( i, E7 h3 M1 `% ` ),
) E; ^! S, H/ q4 j& R- I* D f& |' l% v, I) s7 }2 o
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />, G4 m- N2 J V% S
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br /># [! a9 r; a6 T9 v
<em>*Enter the page post ID number only</em><br />+ F4 ?( z$ | ~& i* Q
<em>*separate by comma</em><br />
3 Z4 m. H" b8 c( x& [8 Q/ M <em>*Exclude pages which you don't want to show on the header navigation</em>",
1 U2 C2 q; ~# s: d1 U- h! T3 Q2 z$ k "id" => $shortname."_header_page_navigation",$ W, p0 g- S* e; {% ~/ Y+ i9 z+ \
"type" => "text",
. z R9 [3 K [6 P$ H( \- b "std" => "",9 v- ^3 F7 S; ^* X
),
7 f) ]! T) R1 A& e9 y1 M# U* w# d# d3 G0 c$ U e: v
array( "name" => "</div></div>",
5 ?4 H, g" @2 Z; Y" ? "type" => "close",& d0 J/ \* R; d n
),
" p0 t' c* J0 Z% ^# n$ P4 ?. J$ c + E# k! d* P- ]3 \( R* _
6 \9 J7 D3 }# R' b+ Z
array( "name" => "Post Auto Thumbnails Settings",( P; o: l. R- q: [
"type" => "heading"," |1 G" q; H6 `- ~8 ^& E) e
),
4 U3 ~7 t" l0 `
9 w% i1 u# W* y. V) _- X9 Z9 J9 H* P array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
H, a' u& B+ N0 W a5 p "id" => $shortname."_timthumb_activate",
$ @2 o9 J2 Q5 ~$ s. l: C6 g1 W "type" => "select",5 e# J6 ^6 A3 m( U E4 c2 c
"std" => "No",
* R# W, i% w8 u/ Y# c" a+ V4 k "options" => array("No", "Yes")),) L1 u1 h- W" k* P: `
1 A6 ^. L; y/ Q- y# y
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
& ^% K# S" s5 [ "id" => $shortname."_timthumb_cropping",0 N) h: u3 P& M3 Y
"type" => "select",' q; L% [! [! V# \# \
"std" => "",6 \' p& h$ _6 u) B, l3 h
"options" => $crop_position),0 ^+ Y* T S1 J
7 Z" y: x! X; S$ d/ v array( "name" => "Insert Width Of Thumbnail Image<br />
9 ]( {, t, f4 p* @" g <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />& j/ r' |3 y2 F Q2 P
<em>*Leave Blank To Use Default: 250</em><br />",
# e& A% T4 b9 U4 o# Q# w "id" => $shortname."_thumb_width",
0 ]1 v. I' @* w7 e% b( k( U( ] "type" => "text",
) E7 B a2 e! k7 S9 A/ [. v9 d "std" => "",
7 h! X# n( C: K- @: A1 z9 D; D% e8 c ),
% t1 p6 M5 ]& |- o0 Q* P2 w/ d- u+ R, Y( M& C" r& h
array( "name" => "Insert Height Of Thumbnail Image<br />
* F, G+ F+ y# [" o& D <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />0 G: f$ O$ a* J, F& Y
<em>*Leave Blank To Use Default: 200</em><br />",. o( t5 x$ v6 H8 |
"id" => $shortname."_thumb_height",, g" ]3 c, c3 Z
"type" => "text",! q0 e8 j1 @8 @1 s7 y% U& w7 ^
"std" => "",
, j( a/ O8 c0 W4 V ),
, {1 B' d2 j( r) q8 t+ M& Z! D
+ A Q! Q' q8 I8 d: x$ G2 f array( "name" => "</div></div>",
+ L) G5 l7 w% U5 Q7 S$ V "type" => "close",
. l. H/ n( w4 ]( Z. h# A ),
5 E1 T$ k4 R q" S. ^' }8 E: Y+ U0 O& X
array( "name" => "Featured Content Slider Settings",
( f! D2 A5 P9 r% \0 w H( b "type" => "heading",
2 G, ^6 B: g/ N: Y" n- ? ),
4 c- m( p1 \! c; y7 @9 K7 x% ^9 k
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& q0 A. b0 f: |2 q, @, F
"id" => $shortname."_featured_activate",
1 W- o. M7 D' f "type" => "select",6 R% G$ H; J# I: q
"std" => "No",( G! Q( L: Y. T6 t0 S
"options" => array("No", "Yes")),. q i1 i, |3 r! }7 Z+ L
3 N1 n- L5 v% A+ h3 u4 X0 O
4 s# L( ?! O7 x1 L' ]$ A/ s9 \
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
% }4 n& M* @ F6 d "id" => $shortname."_featured_category",* p+ x1 q: E% n' G6 g+ {, T6 n, M
"type" => "select",
8 E& Z7 Z" K3 l3 a) g/ |; j# t r "std" => "Choose a category:",% v+ {" N" f6 a/ L% E2 Z7 r
"options" => $wp_getcat),3 r& C. v+ S; k. W& I; y0 b
+ ^& ?, D- y3 T$ ^' G2 @' T
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",8 A ~* V5 }/ T4 k3 I+ V6 Z, \
"id" => $shortname."_featured_number",- R0 \* h4 v+ G/ W! G' A
"type" => "select",
/ o- H% Q5 z5 T, V6 E "std" => "Number of post:",/ v: \$ w1 n8 `4 Q5 J+ {
"options" => $number_entries),
! Q7 O. Q1 Y0 L$ Q# K9 R/ L
f* S9 K( j& N9 F; g% T6 c array( "name" => "</div></div>",
/ ]+ D/ G4 ^" |/ E "type" => "close",+ @" h6 T t: F' h8 G2 R6 F) s
),
: h3 X a: h6 O
" l( u3 Q6 D; B- d6 ` array( "name" => "Featured Category Settings",2 O( _) J# `$ P; p% R% C. ^) i' [. r3 y
"type" => "heading",. J; D$ T1 |" ]6 Z
),6 z2 }; P; s4 b1 H0 J$ y& r2 T
/ R2 V' L& y7 X array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 }( X6 }: p" a4 m' |
"id" => $shortname."_featured_category_activate",
) S! N$ S3 S( D "type" => "select",
+ h- W/ w+ R9 q1 Z+ R3 J. ]# f "std" => "No",
, w8 o: Y. F1 W" ]. h "options" => array("No", "Yes")),9 H/ Y) H$ m1 ~: i7 X. W, e8 ]
* Z/ r4 ^; ]& E% @7 z9 S+ P* G7 B array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
( c3 }! G A: |- |- p* s2 ? "id" => $shortname."_featured_category_id1",$ d+ C9 b$ R* }; b
"type" => "select",4 V O- f4 G- }/ U% a3 y7 p
"std" => "Choose a category:",
% {0 @) y$ w. m& K5 Y' c "options" => $wp_getcat),
: x6 p( B+ P5 s4 X / {6 _7 P3 \* g7 j7 X. t( r
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",/ O% F: q8 ^$ _# L4 P7 Z
"id" => $shortname."_featured_number1",
9 ~, R: y" r8 _6 b$ K7 U! h# t8 B: ] "type" => "select",
* h6 c7 _8 l$ ]5 Z3 d4 K "std" => "Number of post:"," j5 D) q. }9 q {2 c# R
"options" => $number_entries),- U) ~4 C) ^& [5 f6 ?+ _, h3 @
: U ~$ w2 T! h& @: O6 Y' g array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",! |1 }, [1 X/ ^3 V
"id" => $shortname."_featured_category_id2",; l$ N2 {6 a6 N: | x- L
"type" => "select"," r# k8 a& K5 k* \! [1 B
"std" => "Choose a category:",
( \# R6 p# G% a1 [$ j# z2 y3 u "options" => $wp_getcat),. b C. V6 d# B1 w( |
' c0 L' r8 {7 ~$ L# V
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",7 S: {! F( o2 W3 i% I. n
"id" => $shortname."_featured_number2",
- t( z- G4 J' X6 g3 ? "type" => "select",% u6 F- r% W" c$ C D5 ?. Z
"std" => "Number of post:", q/ H8 `% F8 w$ ^2 A! `
"options" => $number_entries),
6 Z- G- N( x2 g 7 {/ {2 V3 q; L: W+ I
( H3 }8 O2 g* u. ^ array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",2 I0 J& y1 O& x* Y5 F& R# g
"id" => $shortname."_featured_category_id3",+ F" s, y: i/ n3 B- F0 e
"type" => "select",' Z$ Z: F5 @6 T' D( Z
"std" => "Choose a category:",
0 f' u# |& G$ x% P6 r "options" => $wp_getcat),, i. J: c" v3 c$ b9 P! I
0 H' S7 S3 a6 d) M, j# S. K8 X8 h array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
/ Z$ H8 L0 o: E5 @7 j( n: P "id" => $shortname."_featured_number3",
+ B( c. O8 v& _; } "type" => "select",2 I9 K) N8 D8 |: a
"std" => "Number of post:",7 `) b8 H7 |. ^) G2 f& O% \
"options" => $number_entries),) Z9 o- q3 ^) b. |6 F7 c
( b* f8 j% Y0 t: h; }7 q: x" {6 J
array( "name" => "</div></div>",
. S6 n# ]4 t/ V+ i" f "type" => "close",
" C2 i* Z6 f" |# i, { ),: T# M6 y0 k% X
4 ~6 _0 e5 A' ^( s+ N
; Z; v; ?. ? a L& U( [ array( "name" => "Google Adsense & Analytics Settings",% ~% w- y) j3 Z+ D
"type" => "heading",
: v, A X5 _4 f/ a' k ),* n8 y( @0 ?" U$ D
. U# }. R' C& A) `( J! E. a7 G/ v7 N
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",4 t! J7 C7 n: h
"id" => $shortname."_adsense_loop_activate",
" _$ G$ M( r8 a8 ?4 w3 [, c4 M "type" => "select",& C" m: H6 Q/ }; ~3 V% w7 G
"std" => "Disable",
* O0 q: z7 H; U, k, d "options" => array("Disable", "Enable")),0 \% n& G- ]! U: ]" l1 v
9 N' y- l7 b N2 J' V0 W E array( "name" => "Insert Google Adsense Code For Loops Here<br />
: P8 n& P/ Q' V: V7 N <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
, H% t' x1 v1 M2 D* E9 E "id" => $shortname."_adsense_loop",# L) m0 y) _# O1 z9 [! u9 Z/ S
"type" => "textarea",
6 G$ e* k7 B) O2 v7 n9 h( `, }. @ "std" => "",
! l, _ g( S- f) ^ ),
, }; Y, ~: J' ~9 A& F. L6 r( @' U) ^5 K
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",! O" X, h' v. J) q* u1 j
"id" => $shortname."_adsense_single_activate",, x, `* t% z* Q/ m/ t
"type" => "select",+ @9 Z/ r$ v l% ]% L+ g
"std" => "Disable",
2 @5 }1 D7 n" y5 D- e) n+ f "options" => array("Disable", "Enable")),5 J3 S2 I3 j7 b! `4 b
" W" u1 H! b( j0 P& ?4 o
array( "name" => "Insert Google Adsense Code For Single Page Here<br />6 a! g1 B3 Q/ a/ j. k
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",; x" x) N. h+ \, F8 K
"id" => $shortname."_adsense_single",1 J1 z& G: O% M: Y q8 f6 N; E/ ?
"type" => "textarea",
+ i0 F+ @2 D, }' @ "std" => "",6 y9 E: s) s( J# A& r8 {
),, e/ }- @. r7 ?- k. s9 J
, F; t+ N8 \5 r! a
+ O- y- F2 o, `! l! ^/ P7 t
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
k3 b, Q- \/ {7 m2 ^5 t "id" => $shortname."_google_analytics",
/ e& ~( _7 P- U1 H4 l2 Q: [ "type" => "textarea",
* K8 P7 u/ _) c* e "std" => "",
- h; G: j0 W. C9 ?( j ),+ k. |, [9 j. B8 c: ?( T- E
6 i3 |# W3 a3 ~, g7 v+ j array( "name" => "</div></div>",
y* I ]* x1 N/ `( b "type" => "close",/ T" L/ S8 Q( g: p
),; X2 [$ r/ C8 ^$ b' x4 y; N
8 ~( O: y" ~3 `3 A# R/ j
7 M ]( m) y" s( r9 w array( "name" => "AddThis Social Bookmarking Settings",
; T; y+ ]3 \. z% @4 c7 Z* S "type" => "heading",0 ~" _, C" e* @# I2 z2 d
),
0 z) M. @# t v' ], }6 D7 W
9 e0 w1 I$ d( o5 Y array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
2 M+ F6 n6 J$ F <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",/ `# F8 P- X! b" i; a
"id" => $shortname."_addthis",7 F+ g0 `; p: k; v
"type" => "text",. q8 `6 A; u1 x+ v2 ^& v
"box" => "social",8 } @2 e; u" K( a
"std" => "",
w/ U k. ~5 d0 z. w ),
: g7 `. }" S: w; G) g! M# l: |. W* l2 ^; Z: g: Z
array( "name" => "</div></div>",
$ w. l% h$ O- E' {1 m "type" => "close",6 W [% N* r" q3 ~- U+ U9 U
),* @8 |" e8 V9 \' {$ u$ d* t1 I2 v
/ D. |9 `) R1 _6 _/ ~. r- I1 l
( a( u! n7 i( M4 S+ Z" }3 D4 [
4 B2 ^& u d5 }% u- _
array( "name" => "YouTube Video Settings",6 k( @" l4 f5 Z+ E
"type" => "heading",& s- ^' o5 ?, b8 j8 J
),
0 g) S/ |% Y7 M5 |! h. e
+ w; @% v1 p$ O( }7 \! @ array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",: I1 k3 P0 u/ Z+ k$ y
"id" => $shortname."_emvideo_activate",
# N6 r% D2 }$ F$ Y "type" => "select",
" b- E! w! ]3 I# g! T h# x% s "std" => "No",6 Q% [" ?$ i9 Y
"options" => array("No", "Yes")),
1 X4 ^ X# s; }9 o+ s0 K/ F8 J8 _6 ]& w8 N
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>",+ K% i; \+ Z2 \- t5 ] f
"id" => $shortname."_emvideo",! w# t! W9 J% m
"std" => "",9 t, M/ u6 A, `- ^+ q4 N( U. w
"type" => "text"),: R% C- i \8 m. y0 a$ `% h
9 s0 n- q: k$ Q' N
array( "name" => "</div></div>",
/ X1 M( e+ N l% X- F "type" => "close",& l0 J* z8 Y5 S: U+ r4 u
),3 K; q* I6 E0 Y! M' m
" q* q6 x8 n+ ?* ~; f( n: y2 x2 g
array( "name" => "Twitter Settings",
/ @7 {' v8 k# V; D; `& Q! X- u "type" => "heading",
" R& F! A) ^+ M' |$ V0 G ),
& h0 l7 O1 `' R0 D* Z) @# K7 P+ } a
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",# C. \0 l3 L$ p( D, \# A5 w
"id" => $shortname."_twitter_activate",& A6 \) C; h& y/ j& F
"type" => "select",
1 N$ o, [, \$ L$ x& V$ U7 J0 j8 v) ^7 H "std" => "No",
! l$ m0 e; h3 B$ ]' p* T6 M5 b "options" => array("No", "Yes")),: a. V* o3 u- }9 U
2 o- K0 o3 }3 Y7 }3 N) G
array( "name" => "Insert Your Twitter ID here# B) C! ^" D) U8 z6 w5 ?
<br /><em>*leave blank if not necessary</em>
+ K7 B0 _" b& s) V <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
# l4 v2 h+ |! i- E1 x% N. ^( b "id" => $shortname."_twitter",
4 s0 g2 Q/ `$ M "type" => "text",
* @; q7 w& d9 d "box" => "social",
! a/ Q! O+ @: r# {* ~0 w) r) r O) D "std" => "",6 s% P a' r7 V
),3 Q% z+ O% A1 u
; P8 g, V; z! v9 \& Z array( "name" => "Enter Twitter Feed Count here
' ~- B) v* B' k <br /><em>*leave blank if not necessary</em>
1 \" F m: l% A4 G <br /><em>*Enter How Many Twitter Feed To Display</em>",
0 A# _6 M j4 C6 H1 x "id" => $shortname."_twitter_count",
1 e( J8 [$ M1 ^. l; G5 F "type" => "text",& M2 `: ?+ Y3 C: R) i/ |
"box" => "social",
4 f9 i8 P5 T; ]' q5 @* a) b "std" => "",0 V1 c q- E: K2 {
),, a8 S2 ]/ q! m8 M" o8 E0 a5 y
( q/ m. H+ \8 l! V4 {4 n# L3 y
array( "name" => "</div></div>",
; v, C0 }' X) ^8 i! V& f "type" => "close",
' h9 D* B* Z' Y, g, e )," H. N7 x" Y" {7 v
: O1 X9 K2 m U) M) \4 V9 l( W
' c3 K( Y6 u& P1 Z, ^
array( "name" => "125 x 125 Banners Advertisement Settings",
* G+ ^5 t& H5 v5 h9 N "type" => "heading",
" B& U) _+ O% b% Y ),
( ` c' K! J( h* p
+ w6 ?5 P8 G, E; T$ e4 j' d8 | array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
0 n* [% r; u% k9 r# ^ "id" => $shortname."_sponsor_activate",( f$ p; H& H) _6 J
"type" => "select",7 G5 f( z) q' f! g* G! `% P/ s
"std" => "No",
% [) [1 ~# i" O& E7 R5 o "options" => array("No", "Yes")),
- H: `3 z3 B% R3 B0 o- O
) _4 ]1 n# G' V V$ L Z
/ I3 a9 a7 R' \' Y' e; @. Z" z g9 G; z4 Y array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",5 ^, o+ K; s/ g7 L9 s; [. i
"id" => $shortname."_sponsor_banner_one",. u2 e9 e" q( ? K; w
"type" => "textarea",+ T0 d6 e# o# ~0 u' x' o4 |3 i7 [/ Y
"std" => "",
3 O# ?$ t' B4 I' e- t ), & z# i: ^% a. x- E) {2 l' h0 Y
0 A9 H+ k) p1 r" \- l+ J0 z array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",5 t% g7 Q+ @1 k: y
"id" => $shortname."_sponsor_banner_two",
1 a) h3 I, C' n9 Z0 E, ] "type" => "textarea",
6 F6 g; h& n( f! Z "std" => "",
2 j3 V7 |( ]" w1 |5 D: d ), X/ s2 K& W$ v+ S
+ z2 Y' J% \( H$ u1 [
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",! X; g( {6 O1 o. j
"id" => $shortname."_sponsor_banner_three",
. n! y( `7 }- j% c" W "type" => "textarea",
4 X+ {$ |) R# j6 x$ E5 L! _ "std" => "",
: E7 |6 l8 [0 U( v+ [; _/ [ ),+ L* v1 B, r8 Z6 v: _4 ]) e
1 K: q$ |" s$ w# n0 _3 K9 y
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",' j) o8 u: C: V' W, L
"id" => $shortname."_sponsor_banner_four",
. |) F2 h% g0 B( k9 A "type" => "textarea",4 D( K' o4 e8 G
"std" => "",6 F% Q8 ~) g; y. Z6 u
),: r6 E: }7 V' _$ ~
2 \9 u( \5 d B+ U
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",! d2 d/ J! `/ @: [+ L
"id" => $shortname."_sponsor_banner_five",$ u, E) W$ L* m/ N
"type" => "textarea",8 c4 u. k* Q: r$ s, @2 r6 H6 L
"std" => "",! o, ] ]4 }- Y0 u4 U) p% C
),
2 O# Q1 H+ P' f; G( E" \& F
9 A5 T, |* F8 z0 ?+ [ array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
$ b3 C) L8 U# f$ I3 H "id" => $shortname."_sponsor_banner_six",7 {3 k. r, L* F5 a& i4 F; _" l
"type" => "textarea",. F! P$ U" L) `# Q- Y
"std" => "",
- C6 H1 w6 \, K; B. [# Q ),+ c( R5 H+ q0 x7 a1 v/ {( s
! y8 i/ U$ }4 S) S5 q* ~3 X( G array( "name" => "</div></div>",9 ~; I: @6 v! l9 c3 _2 T7 J ?
"type" => "close",2 B8 h/ c4 m" I
),5 F& W& M2 g0 `1 J H% j7 a
9 d# F1 D9 P- j% H [/ f* f6 p& S# l* s9 t1 ~- q" C* U) d' ~% E7 i
/ f B f+ {+ E3 G$ F: d
);* d* W! d9 X. G0 [9 w3 _
6 [9 `- J" l# E3 C. W6 D) u: c7 D
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {0 v; {/ Y ~0 s( J: s Z
- ^$ c9 G" f, g. t5 iecho "<div id=\"admin-options\"> ";
1 N4 N2 {1 C, T# {, z4 N. u9 r9 }+ M* ]# r. v2 r6 E0 ?! n8 I
global $themename, $shortname, $options;, S% Q% G0 E9 ` d9 p. J
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
9 Z5 q& t$ m# A7 V8 nif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';5 I/ |; j* v9 c3 B; }0 d5 ^. A, r
?>5 u; t" z0 d- C) @* ?" S
$ r6 c1 q5 ^; Z6 o- h- I: W/ U
<h4><?php echo "$themename"; ?> Theme Options</h4>2 l" o$ |3 `0 B
5 k- B( p( ~: y' ^2 |4 o<div class="annouce">. }" O6 e, E$ n1 V- L4 K
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
- T- N& R' Z0 A& U<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>7 e, }/ R) _% V0 f6 {
</div>" C. g$ E0 X) x7 w6 u
. o, i# f/ L' f<form action="" method="post">
0 k; a6 [1 x1 f- |) N
$ r7 \: H6 s! w# O4 q4 R: ~4 c<?php foreach ($options as $value) { ?>
% x3 y( ]) H- A2 n) L( k, m+ \$ [+ |9 P: M
<?php switch ( $value['type'] ) { case 'heading': ?>$ I8 o% P! i! U/ W1 m
8 {, ~7 F! U7 P3 D; |) z ?: ]<div class="get-option">& K l0 o- f7 L5 ^
7 Y* \& u+ c _: Y, i' d; P# ~
<h2><?php echo $value['name']; ?></h2>
9 ]$ }5 d# h: L: o
! X' W2 R, S7 E( j- [<div class="option-save"># {6 O2 {7 e0 g1 \0 G
# C5 H- z! x0 \8 H/ X
<?php
' U% S# B5 Q* I Sbreak;
6 Y3 ]! d. \5 m9 m' E/ Zcase 'text':
. H+ I9 p6 i n. i?>/ O$ v5 Y) Y) X" C, `0 x/ C; G
! t) Q( z" F! G) y4 @- D: U5 [/ a6 Z
<div class="description"><?php echo $value['name']; ?></div>
, t0 z& R* r; N+ }<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (& h" n. S/ P, B& u: M0 v
, f3 d j7 I9 J; O& w# r; yget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>% d/ P3 [$ _6 E% y. t
3 s4 E# |6 O9 u3 @4 K
<?php$ b+ j% M. k3 b2 ~
break;, y: f1 a6 I: U6 {
case 'select':' \* k" W% K* {; f0 B0 Q
?>3 I: Q, g4 ^7 K1 g8 [
' c% c0 K K- {! m$ u5 m' t
<div class="description"><?php echo $value['name']; ?></div>
. [& ^* X+ O8 W7 z' F' x. L0 f/ P1 n<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
! D; g5 S4 s# D* M- Z<?php foreach ($value['options'] as $option) { ?>0 w, J, U2 o2 T$ Z' q) t
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
8 k% W" u8 |" A<?php } ?>
8 m: }+ _0 B9 z# ~9 C" X</select>
' X/ x E: A! H* Q</p>0 l R J, g! l5 N! y% d* f2 G
1 _1 o, ^# D9 q( p8 _
<?php
% z$ T$ ?% r: l% j. N- ^8 ^) zbreak;( M8 W J3 h5 M4 _' q
case 'textarea':$ Q9 j$ u [) h: D0 |
$valuex = $value['id'];
% G/ o2 b% r. M ` V6 G% k$valuey = stripslashes($valuex);
! D8 R3 n9 O0 L% b! p7 i2 A( g$video_code = get_settings($valuey);
! x* \- C8 q4 s9 w& j5 ?! C) @?>
$ y+ H( R7 X& [ \3 ?0 F$ {; P9 C. y% U3 \! q: U9 o
<div class="description"><?php echo $value['name']; ?></div>6 i' \+ p% d5 Z6 Z5 s
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }5 o! r5 @2 G! F5 y
7 M# w& k( @9 u7 ~* y T
else { echo $value['std']; } ?></textarea></p>
; V+ n: e; U2 _0 M. b& S* l
9 c/ \6 j$ s+ B: N; |<?php8 a# ]. e' ^ J4 A1 q0 @* \
break;: {* @' S2 i/ c4 M6 ^
case 'close':2 Z9 w+ U; T+ W. L4 }# k% X! t
?>$ q! {2 J' {5 Y9 B7 H" ?
. ]5 D* ]: j: L0 U9 F
<div class="clearfix"></div>" n A0 w, K' ?- v/ S7 E
</div><!-- OPTION SAVE END -->" H" q, @; o! K
# }' N$ x5 \7 L5 p8 K9 S% ?<div class="clearfix"></div>
, y/ e( s3 h/ {) Z; d0 P- u</div><!-- GET OPTION END --># I( @. ^' |6 x; V
6 f/ O' d6 D; _% J4 d
<?php X* N& N4 b* {
break;
& V5 ~9 j+ s. pdefault;4 E( d3 v. [( v0 e: k- ?
?>
2 I: @3 ~7 h; A* t3 T" R) O0 J* `. L
# V) x2 L. X/ _1 q+ A" o
<?php
1 Q! p- n4 Q7 i2 dbreak; } ?>: B% c9 i$ D& \% Y8 P* ?
& H9 X0 A& x; Z$ R9 x% z$ p<?php } ?>* h9 t; Y$ V0 ^) q
1 f& k2 v ?# G$ o; |$ y2 D2 k3 y
<p class="save-p">
' G" G0 T5 B& b s$ s+ `<input name="save" type="submit" class="sbutton" value="Save Options" /># }/ u" [& X6 ?" O: U, ^! h2 i2 v
<input type="hidden" name="action" value="save" />
3 B1 d% q5 W3 K: {2 W6 O# \</p>
& ], B' c, o: l p9 B+ `$ O</form>/ ?' q7 v+ Z5 [9 \) u* m
& g: ^% D! s$ W7 q8 _5 u! M l- `7 }/ T
<form method="post">5 a& R5 _5 Y. ]/ Q) [# i" |
<p class="save-p">
6 S# g9 t! k/ h1 R0 j<input name="reset" type="submit" class="sbutton" value="Reset Options" />6 k6 b8 d x. {4 T& \* X2 T, e& M
<input type="hidden" name="action" value="reset" />
t/ e* r* ?" |</p>0 n1 H% E/ l6 x2 b+ o
</form>0 J( h4 J& Q9 ^
0 {# |+ B2 j5 c</div><!-- ADMIN OPTIONS END -->0 I0 T! J/ Y5 r- m
) Q% b0 Y) F" h' P4 ]6 d! m
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
& Y; Z# i/ E) U0 ^
. ^7 j; q' B/ _0 _) Q2 Wfunction mytheme_admin_register() {# [* s) C9 o9 W6 M4 P
global $themename, $shortname, $options;) Q6 e, N2 j3 a( t
if ( $_GET['page'] == basename(__FILE__) ) {
9 l7 F1 L w$ b& J1 R4 K3 ]8 Uif ( 'save' == $_REQUEST['action'] ) {
! g/ L# \2 w) T& g, w, O# [foreach ($options as $value) {
4 O6 P% M. d% ^ @0 P3 C0 B- Cupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }+ b4 [0 x9 r# B% ]7 q
foreach ($options as $value) {- i" `6 @& L: X p
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }7 b6 L! |3 Z6 U) z$ v: z, S, `/ V
header("Location: themes.php?page=functions.php&saved=true");
1 [5 ^# q: ]7 jdie;
. ]; r% j/ ?$ X- d5 y Y6 U/ Z' O} else if( 'reset' == $_REQUEST['action'] ) {
% Y7 U( h! y$ l6 [. Cforeach ($options as $value) {" v# ?# z' T0 |! [
delete_option( $value['id'] ); }, C" U$ R4 T6 a1 c$ |9 _- {$ [
header("Location: themes.php?page=functions.php&reset=true");# g" M6 b" Y' ]8 b7 _
die;! o( m2 D2 d+ y9 P9 ]8 s1 o
}4 \, O) u- Z3 {$ X0 r8 w
}4 W8 i* G- O8 u8 E( |! h
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
/ p; }: U& Q: \- m& H% K}
5 \+ V; T3 l I* i1 k' U5 c( P. o8 ?/ ]; n, u0 ~
function mytheme_admin_head() { ?>. f' U# r" ~; V$ H$ \0 o; Z. H
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
3 a/ P1 [' ], [7 B<?php }. s# [0 e# ]% I$ B5 v
|
|