|
|

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