|
|

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