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