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