|
|

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