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