|
|

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