|
|

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