|
|

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