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