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