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